Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Resource : azurerm_voice_services_communications_gateway #20607

Merged
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .teamcity/components/generated/services.kt
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,6 @@ var services = mapOf(
"trafficmanager" to "Traffic Manager",
"vmware" to "VMware",
"videoanalyzer" to "Video Analyzer",
"voiceservices" to "Voice Services",
"web" to "Web"
)
3 changes: 3 additions & 0 deletions .teamcity/components/settings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ var serviceTestConfigurationOverrides = mapOf(
// Currently, we have insufficient quota to actually run these, but there are a few nodes in West Europe, so we'll pin it there for now
"vmware" to testConfiguration(parallelism = 3, locationOverride = LocationConfiguration("westeurope", "westus2", "eastus2", false), useDevTestSubscription = true),

// In general, Azure Voice Service is available in several different regions, but each subscription will only be allowlisted for specific regions. The following regions are specified since those regions have been whitelisted by service team for testing purpose.
"voiceservices" to testConfiguration(parallelism = 3, locationOverride = LocationConfiguration("westcentralus", "centraluseuap", "eastus2euap", false), useDevTestSubscription = true),

// Offset start hour to avoid collision with new App Service, reduce frequency of testing days
"web" to testConfiguration(startHour = 3, daysOfWeek = "2,4,6", locationOverride = LocationConfiguration("westeurope", "francecentral", "eastus2", false)),

Expand Down
3 changes: 3 additions & 0 deletions internal/clients/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ import (
trafficManager "github.com/hashicorp/terraform-provider-azurerm/internal/services/trafficmanager/client"
videoAnalyzer "github.com/hashicorp/terraform-provider-azurerm/internal/services/videoanalyzer/client"
vmware "github.com/hashicorp/terraform-provider-azurerm/internal/services/vmware/client"
voiceServices "github.com/hashicorp/terraform-provider-azurerm/internal/services/voiceservices/client"
web "github.com/hashicorp/terraform-provider-azurerm/internal/services/web/client"
)

Expand Down Expand Up @@ -247,6 +248,7 @@ type Client struct {
TrafficManager *trafficManager.Client
VideoAnalyzer *videoAnalyzer.Client
Vmware *vmware.Client
VoiceServices *voiceServices.Client
Web *web.Client
}

Expand Down Expand Up @@ -381,6 +383,7 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error
client.TrafficManager = trafficManager.NewClient(o)
client.VideoAnalyzer = videoAnalyzer.NewClient(o)
client.Vmware = vmware.NewClient(o)
client.VoiceServices = voiceServices.NewClient(o)
client.Web = web.NewClient(o)

return nil
Expand Down
2 changes: 2 additions & 0 deletions internal/provider/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/internal/services/trafficmanager"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/videoanalyzer"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/vmware"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/voiceservices"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/web"
)

Expand Down Expand Up @@ -169,6 +170,7 @@ func SupportedTypedServices() []sdk.TypedServiceRegistration {
search.Registration{},
springcloud.Registration{},
vmware.Registration{},
voiceservices.Registration{},
web.Registration{},
}
services = append(services, autoRegisteredTypedServices()...)
Expand Down
26 changes: 26 additions & 0 deletions internal/services/voiceservices/client/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package client

import (
"github.com/hashicorp/go-azure-sdk/resource-manager/voiceservices/2023-01-31/communicationsgateways"
"github.com/hashicorp/go-azure-sdk/resource-manager/voiceservices/2023-01-31/testlines"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
)

type Client struct {
CommunicationsGatewaysClient *communicationsgateways.CommunicationsGatewaysClient
TestLinesClient *testlines.TestLinesClient
}

func NewClient(o *common.ClientOptions) *Client {

communicationsGatewaysClient := communicationsgateways.NewCommunicationsGatewaysClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&communicationsGatewaysClient.Client, o.ResourceManagerAuthorizer)

testLinesClient := testlines.NewTestLinesClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&testLinesClient.Client, o.ResourceManagerAuthorizer)

return &Client{
CommunicationsGatewaysClient: &communicationsGatewaysClient,
TestLinesClient: &testLinesClient,
}
}
35 changes: 35 additions & 0 deletions internal/services/voiceservices/registration.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package voiceservices

import (
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
)

type Registration struct{}

var (
_ sdk.TypedServiceRegistration = Registration{}
)

// Name is the name of this Service
func (r Registration) Name() string {
return "Voice Services"
}

// WebsiteCategories returns a list of categories which can be used for the sidebar
func (r Registration) WebsiteCategories() []string {
return []string{
"Voice Services",
}
}

// DataSources returns a list of Data Sources supported by this Service
func (r Registration) DataSources() []sdk.DataSource {
return []sdk.DataSource{}
}

// Resources returns a list of Resources supported by this Service
func (r Registration) Resources() []sdk.Resource {
return []sdk.Resource{
CommunicationsGatewayResource{},
}
}
Loading