From c9f72646803a3e0bc749fda5b9ac0204b438ff93 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 6 Jun 2023 00:53:48 +0000 Subject: [PATCH] CodeGen from PR 24297 in Azure/azure-rest-api-specs Merge 6454bad3e6455ec9ee8486c0051e5071a2c3d9db into 399f6f49a1bbafb3ab9f6c02b921e7af27b1ab1b --- .../armvoiceservices/CHANGELOG.md | 11 + .../armvoiceservices/autorest.md | 6 +- .../communicationsgateways_client.go | 28 +- ...municationsgateways_client_example_test.go | 400 ------------------ .../armvoiceservices/constants.go | 22 +- .../voiceservices/armvoiceservices/go.mod | 14 +- .../voiceservices/armvoiceservices/go.sum | 22 +- .../voiceservices/armvoiceservices/models.go | 38 ++ .../armvoiceservices/models_serde.go | 82 ++++ .../nameavailability_client.go | 4 +- .../nameavailability_client_example_test.go | 47 -- .../armvoiceservices/operations_client.go | 4 +- .../operations_client_example_test.go | 55 --- .../armvoiceservices/testlines_client.go | 24 +- .../testlines_client_example_test.go | 178 -------- 15 files changed, 191 insertions(+), 744 deletions(-) delete mode 100644 sdk/resourcemanager/voiceservices/armvoiceservices/communicationsgateways_client_example_test.go delete mode 100644 sdk/resourcemanager/voiceservices/armvoiceservices/nameavailability_client_example_test.go delete mode 100644 sdk/resourcemanager/voiceservices/armvoiceservices/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/voiceservices/armvoiceservices/testlines_client_example_test.go diff --git a/sdk/resourcemanager/voiceservices/armvoiceservices/CHANGELOG.md b/sdk/resourcemanager/voiceservices/armvoiceservices/CHANGELOG.md index ed8a74eb533c..bd2e783606c1 100644 --- a/sdk/resourcemanager/voiceservices/armvoiceservices/CHANGELOG.md +++ b/sdk/resourcemanager/voiceservices/armvoiceservices/CHANGELOG.md @@ -1,5 +1,16 @@ # Release History +## 1.1.0 (2023-06-06) +### Features Added + +- New enum type `ManagedServiceIdentityType` with values `ManagedServiceIdentityTypeNone`, `ManagedServiceIdentityTypeSystemAssigned`, `ManagedServiceIdentityTypeSystemAssignedUserAssigned`, `ManagedServiceIdentityTypeUserAssigned` +- New struct `ManagedServiceIdentity` +- New struct `UserAssignedIdentity` +- New field `Identity` in struct `CommunicationsGateway` +- New field `IntegratedMcpEnabled` in struct `CommunicationsGatewayProperties` +- New field `Identity` in struct `CommunicationsGatewayUpdate` + + ## 1.0.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/voiceservices/armvoiceservices/autorest.md b/sdk/resourcemanager/voiceservices/armvoiceservices/autorest.md index 8e711f2d8f4c..840e1592b7df 100644 --- a/sdk/resourcemanager/voiceservices/armvoiceservices/autorest.md +++ b/sdk/resourcemanager/voiceservices/armvoiceservices/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/aa85f59e259c4b12197b57b221067c40fa2fe3f1/specification/voiceservices/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/aa85f59e259c4b12197b57b221067c40fa2fe3f1/specification/voiceservices/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/voiceservices/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/voiceservices/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.1 +module-version: 1.1.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/voiceservices/armvoiceservices/communicationsgateways_client.go b/sdk/resourcemanager/voiceservices/armvoiceservices/communicationsgateways_client.go index 25a3300504df..af534c6ed6bd 100644 --- a/sdk/resourcemanager/voiceservices/armvoiceservices/communicationsgateways_client.go +++ b/sdk/resourcemanager/voiceservices/armvoiceservices/communicationsgateways_client.go @@ -47,7 +47,7 @@ func NewCommunicationsGatewaysClient(subscriptionID string, credential azcore.To // BeginCreateOrUpdate - Create a CommunicationsGateway // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-31 +// Generated from API version 2023-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - communicationsGatewayName - Unique identifier for this deployment // - resource - Resource create parameters. @@ -70,7 +70,7 @@ func (client *CommunicationsGatewaysClient) BeginCreateOrUpdate(ctx context.Cont // CreateOrUpdate - Create a CommunicationsGateway // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-31 +// Generated from API version 2023-04-03 func (client *CommunicationsGatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, communicationsGatewayName string, resource CommunicationsGateway, options *CommunicationsGatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, communicationsGatewayName, resource, options) if err != nil { @@ -106,7 +106,7 @@ func (client *CommunicationsGatewaysClient) createOrUpdateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-31") + reqQP.Set("api-version", "2023-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resource) @@ -115,7 +115,7 @@ func (client *CommunicationsGatewaysClient) createOrUpdateCreateRequest(ctx cont // BeginDelete - Delete a CommunicationsGateway // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-31 +// Generated from API version 2023-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - communicationsGatewayName - Unique identifier for this deployment // - options - CommunicationsGatewaysClientBeginDeleteOptions contains the optional parameters for the CommunicationsGatewaysClient.BeginDelete @@ -137,7 +137,7 @@ func (client *CommunicationsGatewaysClient) BeginDelete(ctx context.Context, res // Delete - Delete a CommunicationsGateway // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-31 +// Generated from API version 2023-04-03 func (client *CommunicationsGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, communicationsGatewayName string, options *CommunicationsGatewaysClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, communicationsGatewayName, options) if err != nil { @@ -173,7 +173,7 @@ func (client *CommunicationsGatewaysClient) deleteCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-31") + reqQP.Set("api-version", "2023-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,7 +182,7 @@ func (client *CommunicationsGatewaysClient) deleteCreateRequest(ctx context.Cont // Get - Get a CommunicationsGateway // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-31 +// Generated from API version 2023-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - communicationsGatewayName - Unique identifier for this deployment // - options - CommunicationsGatewaysClientGetOptions contains the optional parameters for the CommunicationsGatewaysClient.Get @@ -222,7 +222,7 @@ func (client *CommunicationsGatewaysClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-31") + reqQP.Set("api-version", "2023-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -239,7 +239,7 @@ func (client *CommunicationsGatewaysClient) getHandleResponse(resp *http.Respons // NewListByResourceGroupPager - List CommunicationsGateway resources by resource group // -// Generated from API version 2023-01-31 +// Generated from API version 2023-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - CommunicationsGatewaysClientListByResourceGroupOptions contains the optional parameters for the CommunicationsGatewaysClient.NewListByResourceGroupPager // method. @@ -287,7 +287,7 @@ func (client *CommunicationsGatewaysClient) listByResourceGroupCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-31") + reqQP.Set("api-version", "2023-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -304,7 +304,7 @@ func (client *CommunicationsGatewaysClient) listByResourceGroupHandleResponse(re // NewListBySubscriptionPager - List CommunicationsGateway resources by subscription ID // -// Generated from API version 2023-01-31 +// Generated from API version 2023-04-03 // - options - CommunicationsGatewaysClientListBySubscriptionOptions contains the optional parameters for the CommunicationsGatewaysClient.NewListBySubscriptionPager // method. func (client *CommunicationsGatewaysClient) NewListBySubscriptionPager(options *CommunicationsGatewaysClientListBySubscriptionOptions) *runtime.Pager[CommunicationsGatewaysClientListBySubscriptionResponse] { @@ -347,7 +347,7 @@ func (client *CommunicationsGatewaysClient) listBySubscriptionCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-31") + reqQP.Set("api-version", "2023-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -365,7 +365,7 @@ func (client *CommunicationsGatewaysClient) listBySubscriptionHandleResponse(res // Update - Update a CommunicationsGateway // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-31 +// Generated from API version 2023-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - communicationsGatewayName - Unique identifier for this deployment // - properties - The resource properties to be updated. @@ -406,7 +406,7 @@ func (client *CommunicationsGatewaysClient) updateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-31") + reqQP.Set("api-version", "2023-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, properties) diff --git a/sdk/resourcemanager/voiceservices/armvoiceservices/communicationsgateways_client_example_test.go b/sdk/resourcemanager/voiceservices/armvoiceservices/communicationsgateways_client_example_test.go deleted file mode 100644 index e469f565fb4a..000000000000 --- a/sdk/resourcemanager/voiceservices/armvoiceservices/communicationsgateways_client_example_test.go +++ /dev/null @@ -1,400 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armvoiceservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/voiceservices/armvoiceservices" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aa85f59e259c4b12197b57b221067c40fa2fe3f1/specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_ListBySubscription.json -func ExampleCommunicationsGatewaysClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armvoiceservices.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCommunicationsGatewaysClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CommunicationsGatewayListResult = armvoiceservices.CommunicationsGatewayListResult{ - // Value: []*armvoiceservices.CommunicationsGateway{ - // { - // Name: to.Ptr("myname"), - // Type: to.Ptr("Microsoft.VoiceService/communicationsGateways"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.VoiceService/communicationsGateways/myname"), - // Location: to.Ptr("useast"), - // Properties: &armvoiceservices.CommunicationsGatewayProperties{ - // AutoGeneratedDomainNameLabel: to.Ptr("somelabel"), - // AutoGeneratedDomainNameLabelScope: to.Ptr(armvoiceservices.AutoGeneratedDomainNameLabelScopeNoReuse), - // Codecs: []*armvoiceservices.TeamsCodecs{ - // to.Ptr(armvoiceservices.TeamsCodecsPCMA)}, - // Connectivity: to.Ptr(armvoiceservices.ConnectivityPublicAddress), - // E911Type: to.Ptr(armvoiceservices.E911TypeStandard), - // Platforms: []*armvoiceservices.CommunicationsPlatform{ - // to.Ptr(armvoiceservices.CommunicationsPlatformOperatorConnect)}, - // ServiceLocations: []*armvoiceservices.ServiceRegionProperties{ - // { - // Name: to.Ptr("useast"), - // PrimaryRegionProperties: &armvoiceservices.PrimaryRegionProperties{ - // AllowedMediaSourceAddressPrefixes: []*string{ - // to.Ptr("10.1.2.0/24")}, - // AllowedSignalingSourceAddressPrefixes: []*string{ - // to.Ptr("10.1.1.0/24")}, - // OperatorAddresses: []*string{ - // to.Ptr("198.51.100.1")}, - // }, - // }, - // { - // Name: to.Ptr("useast2"), - // PrimaryRegionProperties: &armvoiceservices.PrimaryRegionProperties{ - // AllowedMediaSourceAddressPrefixes: []*string{ - // to.Ptr("10.2.2.0/24")}, - // AllowedSignalingSourceAddressPrefixes: []*string{ - // to.Ptr("10.2.1.0/24")}, - // OperatorAddresses: []*string{ - // to.Ptr("198.51.100.2")}, - // }, - // }}, - // Status: to.Ptr(armvoiceservices.StatusChangePending), - // TeamsVoicemailPilotNumber: to.Ptr("1234567890"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aa85f59e259c4b12197b57b221067c40fa2fe3f1/specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_ListByResourceGroup.json -func ExampleCommunicationsGatewaysClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armvoiceservices.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCommunicationsGatewaysClient().NewListByResourceGroupPager("testrg", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CommunicationsGatewayListResult = armvoiceservices.CommunicationsGatewayListResult{ - // Value: []*armvoiceservices.CommunicationsGateway{ - // { - // Name: to.Ptr("myname"), - // Type: to.Ptr("Microsoft.VoiceService/communicationsGateways"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.VoiceService/communicationsGateways/myname"), - // Location: to.Ptr("useast"), - // Properties: &armvoiceservices.CommunicationsGatewayProperties{ - // AutoGeneratedDomainNameLabel: to.Ptr("somelabel"), - // AutoGeneratedDomainNameLabelScope: to.Ptr(armvoiceservices.AutoGeneratedDomainNameLabelScopeNoReuse), - // Codecs: []*armvoiceservices.TeamsCodecs{ - // to.Ptr(armvoiceservices.TeamsCodecsPCMA)}, - // Connectivity: to.Ptr(armvoiceservices.ConnectivityPublicAddress), - // E911Type: to.Ptr(armvoiceservices.E911TypeStandard), - // Platforms: []*armvoiceservices.CommunicationsPlatform{ - // to.Ptr(armvoiceservices.CommunicationsPlatformOperatorConnect)}, - // ServiceLocations: []*armvoiceservices.ServiceRegionProperties{ - // { - // Name: to.Ptr("useast"), - // PrimaryRegionProperties: &armvoiceservices.PrimaryRegionProperties{ - // AllowedMediaSourceAddressPrefixes: []*string{ - // to.Ptr("10.1.2.0/24")}, - // AllowedSignalingSourceAddressPrefixes: []*string{ - // to.Ptr("10.1.1.0/24")}, - // OperatorAddresses: []*string{ - // to.Ptr("198.51.100.1")}, - // }, - // }, - // { - // Name: to.Ptr("useast2"), - // PrimaryRegionProperties: &armvoiceservices.PrimaryRegionProperties{ - // AllowedMediaSourceAddressPrefixes: []*string{ - // to.Ptr("10.2.2.0/24")}, - // AllowedSignalingSourceAddressPrefixes: []*string{ - // to.Ptr("10.2.1.0/24")}, - // OperatorAddresses: []*string{ - // to.Ptr("198.51.100.2")}, - // }, - // }}, - // Status: to.Ptr(armvoiceservices.StatusChangePending), - // TeamsVoicemailPilotNumber: to.Ptr("1234567890"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aa85f59e259c4b12197b57b221067c40fa2fe3f1/specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_Get.json -func ExampleCommunicationsGatewaysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armvoiceservices.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCommunicationsGatewaysClient().Get(ctx, "testrg", "myname", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CommunicationsGateway = armvoiceservices.CommunicationsGateway{ - // Name: to.Ptr("myname"), - // Type: to.Ptr("Microsoft.VoiceService/communicationsGateways"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.VoiceService/communicationsGateways/myname"), - // Location: to.Ptr("useast"), - // Properties: &armvoiceservices.CommunicationsGatewayProperties{ - // AutoGeneratedDomainNameLabel: to.Ptr("somelabel"), - // AutoGeneratedDomainNameLabelScope: to.Ptr(armvoiceservices.AutoGeneratedDomainNameLabelScopeNoReuse), - // Codecs: []*armvoiceservices.TeamsCodecs{ - // to.Ptr(armvoiceservices.TeamsCodecsPCMA)}, - // Connectivity: to.Ptr(armvoiceservices.ConnectivityPublicAddress), - // E911Type: to.Ptr(armvoiceservices.E911TypeStandard), - // Platforms: []*armvoiceservices.CommunicationsPlatform{ - // to.Ptr(armvoiceservices.CommunicationsPlatformOperatorConnect)}, - // ServiceLocations: []*armvoiceservices.ServiceRegionProperties{ - // { - // Name: to.Ptr("useast"), - // PrimaryRegionProperties: &armvoiceservices.PrimaryRegionProperties{ - // AllowedMediaSourceAddressPrefixes: []*string{ - // to.Ptr("10.1.2.0/24")}, - // AllowedSignalingSourceAddressPrefixes: []*string{ - // to.Ptr("10.1.1.0/24")}, - // OperatorAddresses: []*string{ - // to.Ptr("198.51.100.1")}, - // }, - // }, - // { - // Name: to.Ptr("useast2"), - // PrimaryRegionProperties: &armvoiceservices.PrimaryRegionProperties{ - // AllowedMediaSourceAddressPrefixes: []*string{ - // to.Ptr("10.2.2.0/24")}, - // AllowedSignalingSourceAddressPrefixes: []*string{ - // to.Ptr("10.2.1.0/24")}, - // OperatorAddresses: []*string{ - // to.Ptr("198.51.100.2")}, - // }, - // }}, - // Status: to.Ptr(armvoiceservices.StatusChangePending), - // TeamsVoicemailPilotNumber: to.Ptr("1234567890"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aa85f59e259c4b12197b57b221067c40fa2fe3f1/specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_CreateOrUpdate.json -func ExampleCommunicationsGatewaysClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armvoiceservices.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCommunicationsGatewaysClient().BeginCreateOrUpdate(ctx, "testrg", "myname", armvoiceservices.CommunicationsGateway{ - Location: to.Ptr("useast"), - Properties: &armvoiceservices.CommunicationsGatewayProperties{ - AutoGeneratedDomainNameLabelScope: to.Ptr(armvoiceservices.AutoGeneratedDomainNameLabelScopeNoReuse), - Codecs: []*armvoiceservices.TeamsCodecs{ - to.Ptr(armvoiceservices.TeamsCodecsPCMA)}, - Connectivity: to.Ptr(armvoiceservices.ConnectivityPublicAddress), - E911Type: to.Ptr(armvoiceservices.E911TypeStandard), - Platforms: []*armvoiceservices.CommunicationsPlatform{ - to.Ptr(armvoiceservices.CommunicationsPlatformOperatorConnect)}, - ServiceLocations: []*armvoiceservices.ServiceRegionProperties{ - { - Name: to.Ptr("useast"), - PrimaryRegionProperties: &armvoiceservices.PrimaryRegionProperties{ - AllowedMediaSourceAddressPrefixes: []*string{ - to.Ptr("10.1.2.0/24")}, - AllowedSignalingSourceAddressPrefixes: []*string{ - to.Ptr("10.1.1.0/24")}, - OperatorAddresses: []*string{ - to.Ptr("198.51.100.1")}, - }, - }, - { - Name: to.Ptr("useast2"), - PrimaryRegionProperties: &armvoiceservices.PrimaryRegionProperties{ - AllowedMediaSourceAddressPrefixes: []*string{ - to.Ptr("10.2.2.0/24")}, - AllowedSignalingSourceAddressPrefixes: []*string{ - to.Ptr("10.2.1.0/24")}, - OperatorAddresses: []*string{ - to.Ptr("198.51.100.2")}, - }, - }}, - TeamsVoicemailPilotNumber: to.Ptr("1234567890"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CommunicationsGateway = armvoiceservices.CommunicationsGateway{ - // Name: to.Ptr("myname"), - // Type: to.Ptr("Microsoft.Voiceservice/communicationsGateways"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.VoiceService/communicationsGateway/myname"), - // Location: to.Ptr("useast"), - // Properties: &armvoiceservices.CommunicationsGatewayProperties{ - // AutoGeneratedDomainNameLabel: to.Ptr("somelabel"), - // AutoGeneratedDomainNameLabelScope: to.Ptr(armvoiceservices.AutoGeneratedDomainNameLabelScopeNoReuse), - // Codecs: []*armvoiceservices.TeamsCodecs{ - // to.Ptr(armvoiceservices.TeamsCodecsPCMA)}, - // Connectivity: to.Ptr(armvoiceservices.ConnectivityPublicAddress), - // E911Type: to.Ptr(armvoiceservices.E911TypeStandard), - // Platforms: []*armvoiceservices.CommunicationsPlatform{ - // to.Ptr(armvoiceservices.CommunicationsPlatformOperatorConnect)}, - // ServiceLocations: []*armvoiceservices.ServiceRegionProperties{ - // { - // Name: to.Ptr("useast"), - // PrimaryRegionProperties: &armvoiceservices.PrimaryRegionProperties{ - // AllowedMediaSourceAddressPrefixes: []*string{ - // to.Ptr("10.1.2.0/24")}, - // AllowedSignalingSourceAddressPrefixes: []*string{ - // to.Ptr("10.1.1.0/24")}, - // OperatorAddresses: []*string{ - // to.Ptr("198.51.100.1")}, - // }, - // }, - // { - // Name: to.Ptr("useast2"), - // PrimaryRegionProperties: &armvoiceservices.PrimaryRegionProperties{ - // AllowedMediaSourceAddressPrefixes: []*string{ - // to.Ptr("10.2.2.0/24")}, - // AllowedSignalingSourceAddressPrefixes: []*string{ - // to.Ptr("10.2.1.0/24")}, - // OperatorAddresses: []*string{ - // to.Ptr("198.51.100.2")}, - // }, - // }}, - // Status: to.Ptr(armvoiceservices.StatusChangePending), - // TeamsVoicemailPilotNumber: to.Ptr("1234567890"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aa85f59e259c4b12197b57b221067c40fa2fe3f1/specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_Delete.json -func ExampleCommunicationsGatewaysClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armvoiceservices.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCommunicationsGatewaysClient().BeginDelete(ctx, "testrg", "myname", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aa85f59e259c4b12197b57b221067c40fa2fe3f1/specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_Update.json -func ExampleCommunicationsGatewaysClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armvoiceservices.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCommunicationsGatewaysClient().Update(ctx, "testrg", "myname", armvoiceservices.CommunicationsGatewayUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CommunicationsGateway = armvoiceservices.CommunicationsGateway{ - // Name: to.Ptr("myname"), - // Type: to.Ptr("Microsoft.Voiceservice/communicationsGateways"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.VoiceService/communicationsGateway/myname"), - // Location: to.Ptr("useast"), - // Properties: &armvoiceservices.CommunicationsGatewayProperties{ - // AutoGeneratedDomainNameLabel: to.Ptr("somelabel"), - // AutoGeneratedDomainNameLabelScope: to.Ptr(armvoiceservices.AutoGeneratedDomainNameLabelScopeNoReuse), - // Codecs: []*armvoiceservices.TeamsCodecs{ - // to.Ptr(armvoiceservices.TeamsCodecsPCMA)}, - // Connectivity: to.Ptr(armvoiceservices.ConnectivityPublicAddress), - // E911Type: to.Ptr(armvoiceservices.E911TypeStandard), - // Platforms: []*armvoiceservices.CommunicationsPlatform{ - // to.Ptr(armvoiceservices.CommunicationsPlatformOperatorConnect)}, - // ServiceLocations: []*armvoiceservices.ServiceRegionProperties{ - // { - // Name: to.Ptr("useast"), - // PrimaryRegionProperties: &armvoiceservices.PrimaryRegionProperties{ - // AllowedMediaSourceAddressPrefixes: []*string{ - // to.Ptr("10.1.2.0/24")}, - // AllowedSignalingSourceAddressPrefixes: []*string{ - // to.Ptr("10.1.1.0/24")}, - // OperatorAddresses: []*string{ - // to.Ptr("198.51.100.1")}, - // }, - // }, - // { - // Name: to.Ptr("useast2"), - // PrimaryRegionProperties: &armvoiceservices.PrimaryRegionProperties{ - // AllowedMediaSourceAddressPrefixes: []*string{ - // to.Ptr("10.2.2.0/24")}, - // AllowedSignalingSourceAddressPrefixes: []*string{ - // to.Ptr("10.2.1.0/24")}, - // OperatorAddresses: []*string{ - // to.Ptr("198.51.100.2")}, - // }, - // }}, - // Status: to.Ptr(armvoiceservices.StatusChangePending), - // TeamsVoicemailPilotNumber: to.Ptr("1234567890"), - // }, - // } -} diff --git a/sdk/resourcemanager/voiceservices/armvoiceservices/constants.go b/sdk/resourcemanager/voiceservices/armvoiceservices/constants.go index 35292694a568..6acee6d13778 100644 --- a/sdk/resourcemanager/voiceservices/armvoiceservices/constants.go +++ b/sdk/resourcemanager/voiceservices/armvoiceservices/constants.go @@ -11,7 +11,7 @@ package armvoiceservices const ( moduleName = "armvoiceservices" - moduleVersion = "v1.0.1" + moduleVersion = "v1.1.0" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. @@ -134,6 +134,26 @@ func PossibleE911TypeValues() []E911Type { } } +// ManagedServiceIdentityType - Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). +type ManagedServiceIdentityType string + +const ( + ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" + ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned" + ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned, UserAssigned" + ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned" +) + +// PossibleManagedServiceIdentityTypeValues returns the possible values for the ManagedServiceIdentityType const type. +func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType { + return []ManagedServiceIdentityType{ + ManagedServiceIdentityTypeNone, + ManagedServiceIdentityTypeSystemAssigned, + ManagedServiceIdentityTypeSystemAssignedUserAssigned, + ManagedServiceIdentityTypeUserAssigned, + } +} + // Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default // value is "user,system" type Origin string diff --git a/sdk/resourcemanager/voiceservices/armvoiceservices/go.mod b/sdk/resourcemanager/voiceservices/armvoiceservices/go.mod index b7dcb9e59d88..92bc179c3ef4 100644 --- a/sdk/resourcemanager/voiceservices/armvoiceservices/go.mod +++ b/sdk/resourcemanager/voiceservices/armvoiceservices/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/voiceservices/armvo go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/voiceservices/armvoiceservices/go.sum b/sdk/resourcemanager/voiceservices/armvoiceservices/go.sum index 8ba445a8c4da..b6bd7eaad1ba 100644 --- a/sdk/resourcemanager/voiceservices/armvoiceservices/go.sum +++ b/sdk/resourcemanager/voiceservices/armvoiceservices/go.sum @@ -1,31 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/voiceservices/armvoiceservices/models.go b/sdk/resourcemanager/voiceservices/armvoiceservices/models.go index 4c32da154af2..71d2b8d693fe 100644 --- a/sdk/resourcemanager/voiceservices/armvoiceservices/models.go +++ b/sdk/resourcemanager/voiceservices/armvoiceservices/models.go @@ -37,6 +37,9 @@ type CommunicationsGateway struct { // REQUIRED; The geo-location where the resource lives Location *string + // The managed service identities assigned to this resource. + Identity *ManagedServiceIdentity + // The resource-specific properties for this resource. Properties *CommunicationsGatewayProperties @@ -91,6 +94,9 @@ type CommunicationsGatewayProperties struct { // A list of dial strings used for emergency calling. EmergencyDialStrings []*string + // Whether an integrated Mobile Control Point is in use. + IntegratedMcpEnabled *bool + // Whether an on-premises Mobile Control Point is in use. OnPremMcpEnabled *bool @@ -109,6 +115,9 @@ type CommunicationsGatewayProperties struct { // CommunicationsGatewayUpdate - The type used for update operations of the CommunicationsGateway. type CommunicationsGatewayUpdate struct { + // The managed service identities assigned to this resource. + Identity *ManagedServiceIdentity + // Resource tags. Tags map[string]*string } @@ -150,6 +159,26 @@ type CommunicationsGatewaysClientUpdateOptions struct { // placeholder for future optional parameters } +// ManagedServiceIdentity - Managed service identity (system assigned and/or user assigned identities) +type ManagedServiceIdentity struct { + // REQUIRED; Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + Type *ManagedServiceIdentityType + + // The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM + // resource ids in the form: + // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + // The dictionary values can be empty objects ({}) in + // requests. + UserAssignedIdentities map[string]*UserAssignedIdentity + + // READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned + // identity. + PrincipalID *string + + // READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + TenantID *string +} + // NameAvailabilityClientCheckLocalOptions contains the optional parameters for the NameAvailabilityClient.CheckLocal method. type NameAvailabilityClientCheckLocalOptions struct { // placeholder for future optional parameters @@ -333,3 +362,12 @@ type TestLinesClientListByCommunicationsGatewayOptions struct { type TestLinesClientUpdateOptions struct { // placeholder for future optional parameters } + +// UserAssignedIdentity - User assigned identity properties +type UserAssignedIdentity struct { + // READ-ONLY; The client ID of the assigned identity. + ClientID *string + + // READ-ONLY; The principal ID of the assigned identity. + PrincipalID *string +} diff --git a/sdk/resourcemanager/voiceservices/armvoiceservices/models_serde.go b/sdk/resourcemanager/voiceservices/armvoiceservices/models_serde.go index 6593294709c5..140230496e43 100644 --- a/sdk/resourcemanager/voiceservices/armvoiceservices/models_serde.go +++ b/sdk/resourcemanager/voiceservices/armvoiceservices/models_serde.go @@ -86,6 +86,7 @@ func (c *CheckNameAvailabilityResponse) UnmarshalJSON(data []byte) error { func (c CommunicationsGateway) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", c.ID) + populate(objectMap, "identity", c.Identity) populate(objectMap, "location", c.Location) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) @@ -107,6 +108,9 @@ func (c *CommunicationsGateway) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &c.Identity) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &c.Location) delete(rawMsg, key) @@ -174,6 +178,7 @@ func (c CommunicationsGatewayProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "connectivity", c.Connectivity) populate(objectMap, "e911Type", c.E911Type) populate(objectMap, "emergencyDialStrings", c.EmergencyDialStrings) + populate(objectMap, "integratedMcpEnabled", c.IntegratedMcpEnabled) populate(objectMap, "onPremMcpEnabled", c.OnPremMcpEnabled) populate(objectMap, "platforms", c.Platforms) populate(objectMap, "provisioningState", c.ProvisioningState) @@ -213,6 +218,9 @@ func (c *CommunicationsGatewayProperties) UnmarshalJSON(data []byte) error { case "emergencyDialStrings": err = unpopulate(val, "EmergencyDialStrings", &c.EmergencyDialStrings) delete(rawMsg, key) + case "integratedMcpEnabled": + err = unpopulate(val, "IntegratedMcpEnabled", &c.IntegratedMcpEnabled) + delete(rawMsg, key) case "onPremMcpEnabled": err = unpopulate(val, "OnPremMcpEnabled", &c.OnPremMcpEnabled) delete(rawMsg, key) @@ -242,6 +250,7 @@ func (c *CommunicationsGatewayProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CommunicationsGatewayUpdate. func (c CommunicationsGatewayUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "identity", c.Identity) populate(objectMap, "tags", c.Tags) return json.Marshal(objectMap) } @@ -255,6 +264,9 @@ func (c *CommunicationsGatewayUpdate) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "identity": + err = unpopulate(val, "Identity", &c.Identity) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &c.Tags) delete(rawMsg, key) @@ -266,6 +278,45 @@ func (c *CommunicationsGatewayUpdate) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity. +func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "principalId", m.PrincipalID) + populate(objectMap, "tenantId", m.TenantID) + populate(objectMap, "type", m.Type) + populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity. +func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &m.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &m.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -640,6 +691,37 @@ func (t *TestLineUpdate) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity. +func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientId", u.ClientID) + populate(objectMap, "principalId", u.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity. +func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientId": + err = unpopulate(val, "ClientID", &u.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &u.PrincipalID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + func populate(m map[string]any, k string, v any) { if v == nil { return diff --git a/sdk/resourcemanager/voiceservices/armvoiceservices/nameavailability_client.go b/sdk/resourcemanager/voiceservices/armvoiceservices/nameavailability_client.go index 37fccdad1146..967e4087f0cb 100644 --- a/sdk/resourcemanager/voiceservices/armvoiceservices/nameavailability_client.go +++ b/sdk/resourcemanager/voiceservices/armvoiceservices/nameavailability_client.go @@ -47,7 +47,7 @@ func NewNameAvailabilityClient(subscriptionID string, credential azcore.TokenCre // CheckLocal - Check whether the resource name is available in the given region. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-31 +// Generated from API version 2023-04-03 // - location - The location in which uniqueness will be verified. // - body - The check availability request body. // - options - NameAvailabilityClientCheckLocalOptions contains the optional parameters for the NameAvailabilityClient.CheckLocal @@ -83,7 +83,7 @@ func (client *NameAvailabilityClient) checkLocalCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-31") + reqQP.Set("api-version", "2023-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/voiceservices/armvoiceservices/nameavailability_client_example_test.go b/sdk/resourcemanager/voiceservices/armvoiceservices/nameavailability_client_example_test.go deleted file mode 100644 index 54e22f3f4bef..000000000000 --- a/sdk/resourcemanager/voiceservices/armvoiceservices/nameavailability_client_example_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armvoiceservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/voiceservices/armvoiceservices" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aa85f59e259c4b12197b57b221067c40fa2fe3f1/specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/NameAvailability_CheckLocal.json -func ExampleNameAvailabilityClient_CheckLocal() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armvoiceservices.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNameAvailabilityClient().CheckLocal(ctx, "useast", armvoiceservices.CheckNameAvailabilityRequest{ - Name: to.Ptr("myname"), - Type: to.Ptr("Microsoft.VoiceServices/CommunicationsGateway"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameAvailabilityResponse = armvoiceservices.CheckNameAvailabilityResponse{ - // Message: to.Ptr("Some error string"), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr(armvoiceservices.CheckNameAvailabilityReasonAlreadyExists), - // } -} diff --git a/sdk/resourcemanager/voiceservices/armvoiceservices/operations_client.go b/sdk/resourcemanager/voiceservices/armvoiceservices/operations_client.go index b7cd0f45840e..05dcddec26b5 100644 --- a/sdk/resourcemanager/voiceservices/armvoiceservices/operations_client.go +++ b/sdk/resourcemanager/voiceservices/armvoiceservices/operations_client.go @@ -40,7 +40,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - List the operations for the provider // -// Generated from API version 2023-01-31 +// Generated from API version 2023-04-03 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -78,7 +78,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-31") + reqQP.Set("api-version", "2023-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/voiceservices/armvoiceservices/operations_client_example_test.go b/sdk/resourcemanager/voiceservices/armvoiceservices/operations_client_example_test.go deleted file mode 100644 index f01c5a9556c3..000000000000 --- a/sdk/resourcemanager/voiceservices/armvoiceservices/operations_client_example_test.go +++ /dev/null @@ -1,55 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armvoiceservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/voiceservices/armvoiceservices" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aa85f59e259c4b12197b57b221067c40fa2fe3f1/specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/Operations_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armvoiceservices.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armvoiceservices.OperationListResult{ - // Value: []*armvoiceservices.Operation{ - // { - // Name: to.Ptr("Microsoft.VoiceService/communicationsGateways/write"), - // Display: &armvoiceservices.OperationDisplay{ - // Description: to.Ptr("Write communicationsGateways resource"), - // Operation: to.Ptr("write"), - // Provider: to.Ptr("Microsoft.VoiceService"), - // Resource: to.Ptr("communicationsGateways"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/voiceservices/armvoiceservices/testlines_client.go b/sdk/resourcemanager/voiceservices/armvoiceservices/testlines_client.go index db3791c43051..1420957b16aa 100644 --- a/sdk/resourcemanager/voiceservices/armvoiceservices/testlines_client.go +++ b/sdk/resourcemanager/voiceservices/armvoiceservices/testlines_client.go @@ -47,7 +47,7 @@ func NewTestLinesClient(subscriptionID string, credential azcore.TokenCredential // BeginCreateOrUpdate - Create a TestLine // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-31 +// Generated from API version 2023-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - communicationsGatewayName - Unique identifier for this deployment // - testLineName - Unique identifier for this test line @@ -71,7 +71,7 @@ func (client *TestLinesClient) BeginCreateOrUpdate(ctx context.Context, resource // CreateOrUpdate - Create a TestLine // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-31 +// Generated from API version 2023-04-03 func (client *TestLinesClient) createOrUpdate(ctx context.Context, resourceGroupName string, communicationsGatewayName string, testLineName string, resource TestLine, options *TestLinesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, communicationsGatewayName, testLineName, resource, options) if err != nil { @@ -111,7 +111,7 @@ func (client *TestLinesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-31") + reqQP.Set("api-version", "2023-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resource) @@ -120,7 +120,7 @@ func (client *TestLinesClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Delete a TestLine // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-31 +// Generated from API version 2023-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - communicationsGatewayName - Unique identifier for this deployment // - testLineName - Unique identifier for this test line @@ -142,7 +142,7 @@ func (client *TestLinesClient) BeginDelete(ctx context.Context, resourceGroupNam // Delete - Delete a TestLine // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-31 +// Generated from API version 2023-04-03 func (client *TestLinesClient) deleteOperation(ctx context.Context, resourceGroupName string, communicationsGatewayName string, testLineName string, options *TestLinesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, communicationsGatewayName, testLineName, options) if err != nil { @@ -182,7 +182,7 @@ func (client *TestLinesClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-31") + reqQP.Set("api-version", "2023-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +191,7 @@ func (client *TestLinesClient) deleteCreateRequest(ctx context.Context, resource // Get - Get a TestLine // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-31 +// Generated from API version 2023-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - communicationsGatewayName - Unique identifier for this deployment // - testLineName - Unique identifier for this test line @@ -235,7 +235,7 @@ func (client *TestLinesClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-31") + reqQP.Set("api-version", "2023-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,7 +252,7 @@ func (client *TestLinesClient) getHandleResponse(resp *http.Response) (TestLines // NewListByCommunicationsGatewayPager - List TestLine resources by CommunicationsGateway // -// Generated from API version 2023-01-31 +// Generated from API version 2023-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - communicationsGatewayName - Unique identifier for this deployment // - options - TestLinesClientListByCommunicationsGatewayOptions contains the optional parameters for the TestLinesClient.NewListByCommunicationsGatewayPager @@ -305,7 +305,7 @@ func (client *TestLinesClient) listByCommunicationsGatewayCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-31") + reqQP.Set("api-version", "2023-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -323,7 +323,7 @@ func (client *TestLinesClient) listByCommunicationsGatewayHandleResponse(resp *h // Update - Update a TestLine // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-31 +// Generated from API version 2023-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - communicationsGatewayName - Unique identifier for this deployment // - testLineName - Unique identifier for this test line @@ -368,7 +368,7 @@ func (client *TestLinesClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-31") + reqQP.Set("api-version", "2023-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, properties) diff --git a/sdk/resourcemanager/voiceservices/armvoiceservices/testlines_client_example_test.go b/sdk/resourcemanager/voiceservices/armvoiceservices/testlines_client_example_test.go deleted file mode 100644 index de83b5469d1f..000000000000 --- a/sdk/resourcemanager/voiceservices/armvoiceservices/testlines_client_example_test.go +++ /dev/null @@ -1,178 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armvoiceservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/voiceservices/armvoiceservices" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aa85f59e259c4b12197b57b221067c40fa2fe3f1/specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_ListByCommunicationsGateway.json -func ExampleTestLinesClient_NewListByCommunicationsGatewayPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armvoiceservices.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTestLinesClient().NewListByCommunicationsGatewayPager("testrg", "myname", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TestLineListResult = armvoiceservices.TestLineListResult{ - // Value: []*armvoiceservices.TestLine{ - // { - // Name: to.Ptr("myline"), - // Type: to.Ptr("Microsoft.Voiceservice/communicationsGateways/testLines"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.VoiceService/communicationsGateway/myname/TestLines/myline"), - // Location: to.Ptr("useast"), - // Properties: &armvoiceservices.TestLineProperties{ - // PhoneNumber: to.Ptr("+1-555-1234"), - // Purpose: to.Ptr(armvoiceservices.TestLinePurposeAutomated), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aa85f59e259c4b12197b57b221067c40fa2fe3f1/specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_Get.json -func ExampleTestLinesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armvoiceservices.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTestLinesClient().Get(ctx, "testrg", "myname", "myline", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TestLine = armvoiceservices.TestLine{ - // Name: to.Ptr("myline"), - // Type: to.Ptr("Microsoft.Voiceservice/communicationsGateways/testLines"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.VoiceService/communicationsGateway/myname/TestLines/myline"), - // Location: to.Ptr("useast"), - // Properties: &armvoiceservices.TestLineProperties{ - // PhoneNumber: to.Ptr("+1-555-1234"), - // Purpose: to.Ptr(armvoiceservices.TestLinePurposeAutomated), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aa85f59e259c4b12197b57b221067c40fa2fe3f1/specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_CreateOrUpdate.json -func ExampleTestLinesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armvoiceservices.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTestLinesClient().BeginCreateOrUpdate(ctx, "testrg", "myname", "myline", armvoiceservices.TestLine{ - Location: to.Ptr("useast"), - Properties: &armvoiceservices.TestLineProperties{ - PhoneNumber: to.Ptr("+1-555-1234"), - Purpose: to.Ptr(armvoiceservices.TestLinePurposeAutomated), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TestLine = armvoiceservices.TestLine{ - // Name: to.Ptr("myline"), - // Type: to.Ptr("Microsoft.Voiceservice/communicationsGateways/testLines"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.VoiceService/communicationsGateway/myname/TestLines/myline"), - // Location: to.Ptr("useast"), - // Properties: &armvoiceservices.TestLineProperties{ - // PhoneNumber: to.Ptr("+1-555-1234"), - // Purpose: to.Ptr(armvoiceservices.TestLinePurposeAutomated), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aa85f59e259c4b12197b57b221067c40fa2fe3f1/specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_Delete.json -func ExampleTestLinesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armvoiceservices.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTestLinesClient().BeginDelete(ctx, "testrg", "myname", "myline", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aa85f59e259c4b12197b57b221067c40fa2fe3f1/specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_Update.json -func ExampleTestLinesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armvoiceservices.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTestLinesClient().Update(ctx, "testrg", "myname", "myline", armvoiceservices.TestLineUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TestLine = armvoiceservices.TestLine{ - // Name: to.Ptr("myline"), - // Type: to.Ptr("Microsoft.Voiceservice/communicationsGateways/testLines"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.VoiceService/communicationsGateway/myname/TestLines/myline"), - // Location: to.Ptr("useast"), - // Properties: &armvoiceservices.TestLineProperties{ - // PhoneNumber: to.Ptr("+1-555-1234"), - // Purpose: to.Ptr(armvoiceservices.TestLinePurposeAutomated), - // }, - // } -}