diff --git a/sdk/resourcemanager/communication/armcommunication/CHANGELOG.md b/sdk/resourcemanager/communication/armcommunication/CHANGELOG.md index 8706d08b6c21..2e1431e42511 100644 --- a/sdk/resourcemanager/communication/armcommunication/CHANGELOG.md +++ b/sdk/resourcemanager/communication/armcommunication/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 2.1.0-beta.1 (2023-10-27) +### Features Added + +- New enum type `ManagedServiceIdentityType` with values `ManagedServiceIdentityTypeNone`, `ManagedServiceIdentityTypeSystemAssigned`, `ManagedServiceIdentityTypeSystemAssignedUserAssigned`, `ManagedServiceIdentityTypeUserAssigned` +- New struct `ManagedServiceIdentity` +- New struct `UserAssignedIdentity` +- New field `Identity` in struct `ServiceResource` +- New field `Identity` in struct `ServiceResourceUpdate` + + ## 2.0.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/communication/armcommunication/autorest.md b/sdk/resourcemanager/communication/armcommunication/autorest.md index b19bcc2b82e2..74cd3934b172 100644 --- a/sdk/resourcemanager/communication/armcommunication/autorest.md +++ b/sdk/resourcemanager/communication/armcommunication/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.0.1 - +module-version: 2.1.0-beta.1 +tag: package-preview-2023-04 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/communication/armcommunication/client_factory.go b/sdk/resourcemanager/communication/armcommunication/client_factory.go index 03015c3dea5a..ef6ff82c3603 100644 --- a/sdk/resourcemanager/communication/armcommunication/client_factory.go +++ b/sdk/resourcemanager/communication/armcommunication/client_factory.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcommunication @@ -38,16 +37,6 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewServicesClient() *ServicesClient { - subClient, _ := NewServicesClient(c.subscriptionID, c.credential, c.options) - return subClient -} - func (c *ClientFactory) NewDomainsClient() *DomainsClient { subClient, _ := NewDomainsClient(c.subscriptionID, c.credential, c.options) return subClient @@ -58,7 +47,17 @@ func (c *ClientFactory) NewEmailServicesClient() *EmailServicesClient { return subClient } +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewSenderUsernamesClient() *SenderUsernamesClient { subClient, _ := NewSenderUsernamesClient(c.subscriptionID, c.credential, c.options) return subClient } + +func (c *ClientFactory) NewServicesClient() *ServicesClient { + subClient, _ := NewServicesClient(c.subscriptionID, c.credential, c.options) + return subClient +} diff --git a/sdk/resourcemanager/communication/armcommunication/constants.go b/sdk/resourcemanager/communication/armcommunication/constants.go index 25c1915355a9..6fe3ff5f7c23 100644 --- a/sdk/resourcemanager/communication/armcommunication/constants.go +++ b/sdk/resourcemanager/communication/armcommunication/constants.go @@ -3,15 +3,14 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcommunication const ( moduleName = "armcommunication" - moduleVersion = "v2.0.1" + moduleVersion = "v2.1.0-beta.1" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. @@ -188,6 +187,26 @@ func PossibleKeyTypeValues() []KeyType { } } +// 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/communication/armcommunication/domains_client.go b/sdk/resourcemanager/communication/armcommunication/domains_client.go index 64974de5d3f0..edb321be76ac 100644 --- a/sdk/resourcemanager/communication/armcommunication/domains_client.go +++ b/sdk/resourcemanager/communication/armcommunication/domains_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcommunication @@ -47,7 +46,7 @@ func NewDomainsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCancelVerification - Cancel verification of DNS record. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - emailServiceName - The name of the EmailService resource. // - domainName - The name of the Domains resource. @@ -60,9 +59,10 @@ func (client *DomainsClient) BeginCancelVerification(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DomainsClientCancelVerificationResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DomainsClientCancelVerificationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[DomainsClientCancelVerificationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ func (client *DomainsClient) BeginCancelVerification(ctx context.Context, resour // CancelVerification - Cancel verification of DNS record. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview func (client *DomainsClient) cancelVerification(ctx context.Context, resourceGroupName string, emailServiceName string, domainName string, parameters VerificationParameter, options *DomainsClientBeginCancelVerificationOptions) (*http.Response, error) { + var err error req, err := client.cancelVerificationCreateRequest(ctx, resourceGroupName, emailServiceName, domainName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // cancelVerificationCreateRequest creates the CancelVerification request. @@ -108,16 +110,19 @@ func (client *DomainsClient) cancelVerificationCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginCreateOrUpdate - Add a new Domains resource under the parent EmailService resource or update an existing Domains resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - emailServiceName - The name of the EmailService resource. // - domainName - The name of the Domains resource. @@ -130,9 +135,10 @@ func (client *DomainsClient) BeginCreateOrUpdate(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DomainsClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DomainsClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[DomainsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -141,20 +147,22 @@ func (client *DomainsClient) BeginCreateOrUpdate(ctx context.Context, resourceGr // CreateOrUpdate - Add a new Domains resource under the parent EmailService resource or update an existing Domains resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview func (client *DomainsClient) createOrUpdate(ctx context.Context, resourceGroupName string, emailServiceName string, domainName string, parameters DomainResource, options *DomainsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, emailServiceName, domainName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -178,16 +186,19 @@ func (client *DomainsClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Operation to delete a Domains resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - emailServiceName - The name of the EmailService resource. // - domainName - The name of the Domains resource. @@ -198,9 +209,10 @@ func (client *DomainsClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DomainsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DomainsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[DomainsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -209,20 +221,22 @@ func (client *DomainsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Operation to delete a Domains resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview func (client *DomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, emailServiceName string, domainName string, options *DomainsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, emailServiceName, domainName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -246,7 +260,7 @@ func (client *DomainsClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,24 +269,27 @@ func (client *DomainsClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Get the Domains resource and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - emailServiceName - The name of the EmailService resource. // - domainName - The name of the Domains resource. // - options - DomainsClientGetOptions contains the optional parameters for the DomainsClient.Get method. func (client *DomainsClient) Get(ctx context.Context, resourceGroupName string, emailServiceName string, domainName string, options *DomainsClientGetOptions) (DomainsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, emailServiceName, domainName, options) if err != nil { return DomainsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DomainsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DomainsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DomainsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -296,7 +313,7 @@ func (client *DomainsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -314,7 +331,7 @@ func (client *DomainsClient) getHandleResponse(resp *http.Response) (DomainsClie // BeginInitiateVerification - Initiate verification of DNS record. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - emailServiceName - The name of the EmailService resource. // - domainName - The name of the Domains resource. @@ -327,9 +344,10 @@ func (client *DomainsClient) BeginInitiateVerification(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DomainsClientInitiateVerificationResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DomainsClientInitiateVerificationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[DomainsClientInitiateVerificationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -338,20 +356,22 @@ func (client *DomainsClient) BeginInitiateVerification(ctx context.Context, reso // InitiateVerification - Initiate verification of DNS record. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview func (client *DomainsClient) initiateVerification(ctx context.Context, resourceGroupName string, emailServiceName string, domainName string, parameters VerificationParameter, options *DomainsClientBeginInitiateVerificationOptions) (*http.Response, error) { + var err error req, err := client.initiateVerificationCreateRequest(ctx, resourceGroupName, emailServiceName, domainName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // initiateVerificationCreateRequest creates the InitiateVerification request. @@ -375,15 +395,18 @@ func (client *DomainsClient) initiateVerificationCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // NewListByEmailServiceResourcePager - Handles requests to list all Domains resources under the parent EmailServices resource. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - emailServiceName - The name of the EmailService resource. // - options - DomainsClientListByEmailServiceResourceOptions contains the optional parameters for the DomainsClient.NewListByEmailServiceResourcePager @@ -433,7 +456,7 @@ func (client *DomainsClient) listByEmailServiceResourceCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -451,7 +474,7 @@ func (client *DomainsClient) listByEmailServiceResourceHandleResponse(resp *http // BeginUpdate - Operation to update an existing Domains resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - emailServiceName - The name of the EmailService resource. // - domainName - The name of the Domains resource. @@ -463,9 +486,10 @@ func (client *DomainsClient) BeginUpdate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DomainsClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DomainsClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[DomainsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -474,20 +498,22 @@ func (client *DomainsClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Operation to update an existing Domains resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview func (client *DomainsClient) update(ctx context.Context, resourceGroupName string, emailServiceName string, domainName string, parameters UpdateDomainRequestParameters, options *DomainsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, emailServiceName, domainName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -511,8 +537,11 @@ func (client *DomainsClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/communication/armcommunication/domains_client_example_test.go b/sdk/resourcemanager/communication/armcommunication/domains_client_example_test.go index 6f2738e82685..0ad6f6ecd14d 100644 --- a/sdk/resourcemanager/communication/armcommunication/domains_client_example_test.go +++ b/sdk/resourcemanager/communication/armcommunication/domains_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/communication/armcommunication/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/domains/get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/domains/get.json func ExampleDomainsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +66,7 @@ func ExampleDomainsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/domains/createOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/domains/createOrUpdate.json func ExampleDomainsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -123,7 +123,7 @@ func ExampleDomainsClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/domains/delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/domains/delete.json func ExampleDomainsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -144,7 +144,7 @@ func ExampleDomainsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/domains/update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/domains/update.json func ExampleDomainsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -210,7 +210,7 @@ func ExampleDomainsClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/domains/listByEmailService.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/domains/listByEmailService.json func ExampleDomainsClient_NewListByEmailServiceResourcePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -275,7 +275,7 @@ func ExampleDomainsClient_NewListByEmailServiceResourcePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/domains/initiateVerification.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/domains/initiateVerification.json func ExampleDomainsClient_BeginInitiateVerification() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -298,7 +298,7 @@ func ExampleDomainsClient_BeginInitiateVerification() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/domains/cancelVerification.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/domains/cancelVerification.json func ExampleDomainsClient_BeginCancelVerification() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/communication/armcommunication/emailservices_client.go b/sdk/resourcemanager/communication/armcommunication/emailservices_client.go index a504f32d891b..41c94ee3a5de 100644 --- a/sdk/resourcemanager/communication/armcommunication/emailservices_client.go +++ b/sdk/resourcemanager/communication/armcommunication/emailservices_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcommunication @@ -47,7 +46,7 @@ func NewEmailServicesClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Create a new EmailService or update an existing EmailService. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - emailServiceName - The name of the EmailService resource. // - parameters - Parameters for the create or update operation @@ -59,9 +58,10 @@ func (client *EmailServicesClient) BeginCreateOrUpdate(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[EmailServicesClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[EmailServicesClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[EmailServicesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,20 +70,22 @@ func (client *EmailServicesClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Create a new EmailService or update an existing EmailService. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview func (client *EmailServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, emailServiceName string, parameters EmailServiceResource, options *EmailServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, emailServiceName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -103,16 +105,19 @@ func (client *EmailServicesClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Operation to delete a EmailService. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - emailServiceName - The name of the EmailService resource. // - options - EmailServicesClientBeginDeleteOptions contains the optional parameters for the EmailServicesClient.BeginDelete @@ -123,9 +128,10 @@ func (client *EmailServicesClient) BeginDelete(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[EmailServicesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[EmailServicesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[EmailServicesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -134,20 +140,22 @@ func (client *EmailServicesClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Operation to delete a EmailService. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview func (client *EmailServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, emailServiceName string, options *EmailServicesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, emailServiceName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -167,7 +175,7 @@ func (client *EmailServicesClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -176,23 +184,26 @@ func (client *EmailServicesClient) deleteCreateRequest(ctx context.Context, reso // Get - Get the EmailService and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - emailServiceName - The name of the EmailService resource. // - options - EmailServicesClientGetOptions contains the optional parameters for the EmailServicesClient.Get method. func (client *EmailServicesClient) Get(ctx context.Context, resourceGroupName string, emailServiceName string, options *EmailServicesClientGetOptions) (EmailServicesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, emailServiceName, options) if err != nil { return EmailServicesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return EmailServicesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return EmailServicesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return EmailServicesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -212,7 +223,7 @@ func (client *EmailServicesClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -229,7 +240,7 @@ func (client *EmailServicesClient) getHandleResponse(resp *http.Response) (Email // NewListByResourceGroupPager - Handles requests to list all resources in a resource group. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - EmailServicesClientListByResourceGroupOptions contains the optional parameters for the EmailServicesClient.NewListByResourceGroupPager // method. @@ -274,7 +285,7 @@ func (client *EmailServicesClient) listByResourceGroupCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -291,7 +302,7 @@ func (client *EmailServicesClient) listByResourceGroupHandleResponse(resp *http. // NewListBySubscriptionPager - Handles requests to list all resources in a subscription. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - options - EmailServicesClientListBySubscriptionOptions contains the optional parameters for the EmailServicesClient.NewListBySubscriptionPager // method. func (client *EmailServicesClient) NewListBySubscriptionPager(options *EmailServicesClientListBySubscriptionOptions) *runtime.Pager[EmailServicesClientListBySubscriptionResponse] { @@ -331,7 +342,7 @@ func (client *EmailServicesClient) listBySubscriptionCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -349,22 +360,25 @@ func (client *EmailServicesClient) listBySubscriptionHandleResponse(resp *http.R // ListVerifiedExchangeOnlineDomains - Get a list of domains that are fully verified in Exchange Online. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - options - EmailServicesClientListVerifiedExchangeOnlineDomainsOptions contains the optional parameters for the EmailServicesClient.ListVerifiedExchangeOnlineDomains // method. func (client *EmailServicesClient) ListVerifiedExchangeOnlineDomains(ctx context.Context, options *EmailServicesClientListVerifiedExchangeOnlineDomainsOptions) (EmailServicesClientListVerifiedExchangeOnlineDomainsResponse, error) { + var err error req, err := client.listVerifiedExchangeOnlineDomainsCreateRequest(ctx, options) if err != nil { return EmailServicesClientListVerifiedExchangeOnlineDomainsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return EmailServicesClientListVerifiedExchangeOnlineDomainsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return EmailServicesClientListVerifiedExchangeOnlineDomainsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return EmailServicesClientListVerifiedExchangeOnlineDomainsResponse{}, err } - return client.listVerifiedExchangeOnlineDomainsHandleResponse(resp) + resp, err := client.listVerifiedExchangeOnlineDomainsHandleResponse(httpResp) + return resp, err } // listVerifiedExchangeOnlineDomainsCreateRequest creates the ListVerifiedExchangeOnlineDomains request. @@ -376,7 +390,7 @@ func (client *EmailServicesClient) listVerifiedExchangeOnlineDomainsCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -394,7 +408,7 @@ func (client *EmailServicesClient) listVerifiedExchangeOnlineDomainsHandleRespon // BeginUpdate - Operation to update an existing EmailService. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - emailServiceName - The name of the EmailService resource. // - parameters - Parameters for the update operation @@ -406,9 +420,10 @@ func (client *EmailServicesClient) BeginUpdate(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[EmailServicesClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[EmailServicesClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[EmailServicesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -417,20 +432,22 @@ func (client *EmailServicesClient) BeginUpdate(ctx context.Context, resourceGrou // Update - Operation to update an existing EmailService. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview func (client *EmailServicesClient) update(ctx context.Context, resourceGroupName string, emailServiceName string, parameters EmailServiceResourceUpdate, options *EmailServicesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, emailServiceName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -450,8 +467,11 @@ func (client *EmailServicesClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/communication/armcommunication/emailservices_client_example_test.go b/sdk/resourcemanager/communication/armcommunication/emailservices_client_example_test.go index c5040360dcee..9da33a9d2680 100644 --- a/sdk/resourcemanager/communication/armcommunication/emailservices_client_example_test.go +++ b/sdk/resourcemanager/communication/armcommunication/emailservices_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/communication/armcommunication/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/emailServices/get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/emailServices/get.json func ExampleEmailServicesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -48,7 +48,7 @@ func ExampleEmailServicesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/emailServices/createOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/emailServices/createOrUpdate.json func ExampleEmailServicesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -87,7 +87,7 @@ func ExampleEmailServicesClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/emailServices/delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/emailServices/delete.json func ExampleEmailServicesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -108,7 +108,7 @@ func ExampleEmailServicesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/emailServices/update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/emailServices/update.json func ExampleEmailServicesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -149,7 +149,7 @@ func ExampleEmailServicesClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/emailServices/listBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/emailServices/listBySubscription.json func ExampleEmailServicesClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -187,7 +187,7 @@ func ExampleEmailServicesClient_NewListBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/emailServices/listByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/emailServices/listByResourceGroup.json func ExampleEmailServicesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -225,7 +225,7 @@ func ExampleEmailServicesClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/emailServices/getVerifiedExchangeOnlineDomains.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/emailServices/getVerifiedExchangeOnlineDomains.json func ExampleEmailServicesClient_ListVerifiedExchangeOnlineDomains() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/communication/armcommunication/go.mod b/sdk/resourcemanager/communication/armcommunication/go.mod index 6d8eb0465e8a..b2c250fdbcf1 100644 --- a/sdk/resourcemanager/communication/armcommunication/go.mod +++ b/sdk/resourcemanager/communication/armcommunication/go.mod @@ -3,19 +3,19 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/communication/armco 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 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1 ) 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/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect + github.com/golang-jwt/jwt/v5 v5.0.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 - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + golang.org/x/crypto v0.12.0 // indirect + golang.org/x/net v0.14.0 // indirect + golang.org/x/sys v0.11.0 // indirect + golang.org/x/text v0.12.0 // indirect ) diff --git a/sdk/resourcemanager/communication/armcommunication/go.sum b/sdk/resourcemanager/communication/armcommunication/go.sum index 8ba445a8c4da..545850a5189d 100644 --- a/sdk/resourcemanager/communication/armcommunication/go.sum +++ b/sdk/resourcemanager/communication/armcommunication/go.sum @@ -1,15 +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/Azure/azure-sdk-for-go/sdk/azcore v1.7.1 h1:/iHxaJhsFr0+xVFfbMr5vxz848jyiWuIEDhYq3y5odY= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1 h1:LNHhpdK7hzUcx/k1LIcuh5k7k1LGIWLQfCjaneSj7Fc= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1/go.mod h1:uE9zaUfEQT/nbQjVi2IblCG9iaLtZsuYZ8ne+PuQ02M= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= +github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 h1:WpB/QDNLpMw72xHJc34BNNykqSOeEJDAWkhf0u12/Jk= +github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= 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/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= +github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= +github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= 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= @@ -18,14 +18,14 @@ github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9 github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= 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/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= +golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= +golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= 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= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/communication/armcommunication/models.go b/sdk/resourcemanager/communication/armcommunication/models.go index 4cbc7c9eb1ab..3d71ce0651c1 100644 --- a/sdk/resourcemanager/communication/armcommunication/models.go +++ b/sdk/resourcemanager/communication/armcommunication/models.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcommunication @@ -144,49 +143,6 @@ type DomainResourceList struct { Value []*DomainResource } -// DomainsClientBeginCancelVerificationOptions contains the optional parameters for the DomainsClient.BeginCancelVerification -// method. -type DomainsClientBeginCancelVerificationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DomainsClientBeginCreateOrUpdateOptions contains the optional parameters for the DomainsClient.BeginCreateOrUpdate method. -type DomainsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DomainsClientBeginDeleteOptions contains the optional parameters for the DomainsClient.BeginDelete method. -type DomainsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DomainsClientBeginInitiateVerificationOptions contains the optional parameters for the DomainsClient.BeginInitiateVerification -// method. -type DomainsClientBeginInitiateVerificationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DomainsClientBeginUpdateOptions contains the optional parameters for the DomainsClient.BeginUpdate method. -type DomainsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DomainsClientGetOptions contains the optional parameters for the DomainsClient.Get method. -type DomainsClientGetOptions struct { - // placeholder for future optional parameters -} - -// DomainsClientListByEmailServiceResourceOptions contains the optional parameters for the DomainsClient.NewListByEmailServiceResourcePager -// method. -type DomainsClientListByEmailServiceResourceOptions struct { - // placeholder for future optional parameters -} - // EmailServiceProperties - A class that describes the properties of the EmailService. type EmailServiceProperties struct { // REQUIRED; The location where the email service stores its data at rest. @@ -235,48 +191,6 @@ type EmailServiceResourceUpdate struct { Tags map[string]*string } -// EmailServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the EmailServicesClient.BeginCreateOrUpdate -// method. -type EmailServicesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// EmailServicesClientBeginDeleteOptions contains the optional parameters for the EmailServicesClient.BeginDelete method. -type EmailServicesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// EmailServicesClientBeginUpdateOptions contains the optional parameters for the EmailServicesClient.BeginUpdate method. -type EmailServicesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// EmailServicesClientGetOptions contains the optional parameters for the EmailServicesClient.Get method. -type EmailServicesClientGetOptions struct { - // placeholder for future optional parameters -} - -// EmailServicesClientListByResourceGroupOptions contains the optional parameters for the EmailServicesClient.NewListByResourceGroupPager -// method. -type EmailServicesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// EmailServicesClientListBySubscriptionOptions contains the optional parameters for the EmailServicesClient.NewListBySubscriptionPager -// method. -type EmailServicesClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// EmailServicesClientListVerifiedExchangeOnlineDomainsOptions contains the optional parameters for the EmailServicesClient.ListVerifiedExchangeOnlineDomains -// method. -type EmailServicesClientListVerifiedExchangeOnlineDomainsOptions struct { - // placeholder for future optional parameters -} - // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. @@ -326,6 +240,26 @@ type LinkedNotificationHub struct { ResourceID *string } +// 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 +} + // NameAvailabilityParameters - Data POST-ed to the nameAvailability action type NameAvailabilityParameters struct { // The name of the resource for which availability needs to be checked. @@ -384,11 +318,6 @@ type OperationListResult struct { Value []*Operation } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - // ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a // location type ProxyResource struct { @@ -468,28 +397,6 @@ type SenderUsernameResourceCollection struct { Value []*SenderUsernameResource } -// SenderUsernamesClientCreateOrUpdateOptions contains the optional parameters for the SenderUsernamesClient.CreateOrUpdate -// method. -type SenderUsernamesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// SenderUsernamesClientDeleteOptions contains the optional parameters for the SenderUsernamesClient.Delete method. -type SenderUsernamesClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// SenderUsernamesClientGetOptions contains the optional parameters for the SenderUsernamesClient.Get method. -type SenderUsernamesClientGetOptions struct { - // placeholder for future optional parameters -} - -// SenderUsernamesClientListByDomainsOptions contains the optional parameters for the SenderUsernamesClient.NewListByDomainsPager -// method. -type SenderUsernamesClientListByDomainsOptions struct { - // placeholder for future optional parameters -} - // ServiceKeys - A class representing the access keys of a CommunicationService. type ServiceKeys struct { // CommunicationService connection string constructed via the primaryKey @@ -534,6 +441,9 @@ type ServiceResource struct { // REQUIRED; The geo-location where the resource lives Location *string + // Managed service identity (system assigned and/or user assigned identities) + Identity *ManagedServiceIdentity + // The properties of the service. Properties *ServiceProperties @@ -564,6 +474,9 @@ type ServiceResourceList struct { // ServiceResourceUpdate - A class representing update parameters for CommunicationService resource. type ServiceResourceUpdate struct { + // Managed service identity (system assigned and/or user assigned identities) + Identity *ManagedServiceIdentity + // The properties of the service. Properties *ServiceUpdateProperties @@ -577,62 +490,6 @@ type ServiceUpdateProperties struct { LinkedDomains []*string } -// ServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServicesClient.BeginCreateOrUpdate method. -type ServicesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServicesClientBeginDeleteOptions contains the optional parameters for the ServicesClient.BeginDelete method. -type ServicesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServicesClientCheckNameAvailabilityOptions contains the optional parameters for the ServicesClient.CheckNameAvailability -// method. -type ServicesClientCheckNameAvailabilityOptions struct { - // placeholder for future optional parameters -} - -// ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method. -type ServicesClientGetOptions struct { - // placeholder for future optional parameters -} - -// ServicesClientLinkNotificationHubOptions contains the optional parameters for the ServicesClient.LinkNotificationHub method. -type ServicesClientLinkNotificationHubOptions struct { - // Parameters supplied to the operation. - LinkNotificationHubParameters *LinkNotificationHubParameters -} - -// ServicesClientListByResourceGroupOptions contains the optional parameters for the ServicesClient.NewListByResourceGroupPager -// method. -type ServicesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ServicesClientListBySubscriptionOptions contains the optional parameters for the ServicesClient.NewListBySubscriptionPager -// method. -type ServicesClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// ServicesClientListKeysOptions contains the optional parameters for the ServicesClient.ListKeys method. -type ServicesClientListKeysOptions struct { - // placeholder for future optional parameters -} - -// ServicesClientRegenerateKeyOptions contains the optional parameters for the ServicesClient.RegenerateKey method. -type ServicesClientRegenerateKeyOptions struct { - // placeholder for future optional parameters -} - -// ServicesClientUpdateOptions contains the optional parameters for the ServicesClient.Update method. -type ServicesClientUpdateOptions struct { - // placeholder for future optional parameters -} - // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). @@ -697,6 +554,15 @@ type UpdateDomainRequestParameters struct { Tags map[string]*string } +// 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 +} + // VerificationParameter - Input parameter for verification APIs type VerificationParameter struct { // REQUIRED; Type of verification. diff --git a/sdk/resourcemanager/communication/armcommunication/models_serde.go b/sdk/resourcemanager/communication/armcommunication/models_serde.go index e02a5c4170f1..77ca041cf38c 100644 --- a/sdk/resourcemanager/communication/armcommunication/models_serde.go +++ b/sdk/resourcemanager/communication/armcommunication/models_serde.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcommunication @@ -643,6 +642,45 @@ func (l *LinkedNotificationHub) 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 NameAvailabilityParameters. func (n NameAvailabilityParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1099,6 +1137,7 @@ func (s *ServiceProperties) UnmarshalJSON(data []byte) error { func (s ServiceResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -1120,6 +1159,9 @@ func (s *ServiceResource) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &s.Identity) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &s.Location) delete(rawMsg, key) @@ -1180,6 +1222,7 @@ func (s *ServiceResourceList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ServiceResourceUpdate. func (s ServiceResourceUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "identity", s.Identity) populate(objectMap, "properties", s.Properties) populate(objectMap, "tags", s.Tags) return json.Marshal(objectMap) @@ -1194,6 +1237,9 @@ func (s *ServiceResourceUpdate) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "identity": + err = unpopulate(val, "Identity", &s.Identity) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) @@ -1414,6 +1460,37 @@ func (u *UpdateDomainRequestParameters) 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 +} + // MarshalJSON implements the json.Marshaller interface for type VerificationParameter. func (v VerificationParameter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/communication/armcommunication/operations_client.go b/sdk/resourcemanager/communication/armcommunication/operations_client.go index fcd8f1f9f31d..2fc5c16f30b2 100644 --- a/sdk/resourcemanager/communication/armcommunication/operations_client.go +++ b/sdk/resourcemanager/communication/armcommunication/operations_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcommunication @@ -40,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available REST API operations of the Microsoft.Communication provider. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - 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 +77,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/communication/armcommunication/operations_client_example_test.go b/sdk/resourcemanager/communication/armcommunication/operations_client_example_test.go index dd5ed40ca6ed..805bc655d035 100644 --- a/sdk/resourcemanager/communication/armcommunication/operations_client_example_test.go +++ b/sdk/resourcemanager/communication/armcommunication/operations_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/communication/armcommunication/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/communicationServices/operationsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/operationsList.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/communication/armcommunication/options.go b/sdk/resourcemanager/communication/armcommunication/options.go new file mode 100644 index 000000000000..383564f06879 --- /dev/null +++ b/sdk/resourcemanager/communication/armcommunication/options.go @@ -0,0 +1,177 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcommunication + +// DomainsClientBeginCancelVerificationOptions contains the optional parameters for the DomainsClient.BeginCancelVerification +// method. +type DomainsClientBeginCancelVerificationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DomainsClientBeginCreateOrUpdateOptions contains the optional parameters for the DomainsClient.BeginCreateOrUpdate method. +type DomainsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DomainsClientBeginDeleteOptions contains the optional parameters for the DomainsClient.BeginDelete method. +type DomainsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DomainsClientBeginInitiateVerificationOptions contains the optional parameters for the DomainsClient.BeginInitiateVerification +// method. +type DomainsClientBeginInitiateVerificationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DomainsClientBeginUpdateOptions contains the optional parameters for the DomainsClient.BeginUpdate method. +type DomainsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DomainsClientGetOptions contains the optional parameters for the DomainsClient.Get method. +type DomainsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DomainsClientListByEmailServiceResourceOptions contains the optional parameters for the DomainsClient.NewListByEmailServiceResourcePager +// method. +type DomainsClientListByEmailServiceResourceOptions struct { + // placeholder for future optional parameters +} + +// EmailServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the EmailServicesClient.BeginCreateOrUpdate +// method. +type EmailServicesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// EmailServicesClientBeginDeleteOptions contains the optional parameters for the EmailServicesClient.BeginDelete method. +type EmailServicesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// EmailServicesClientBeginUpdateOptions contains the optional parameters for the EmailServicesClient.BeginUpdate method. +type EmailServicesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// EmailServicesClientGetOptions contains the optional parameters for the EmailServicesClient.Get method. +type EmailServicesClientGetOptions struct { + // placeholder for future optional parameters +} + +// EmailServicesClientListByResourceGroupOptions contains the optional parameters for the EmailServicesClient.NewListByResourceGroupPager +// method. +type EmailServicesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// EmailServicesClientListBySubscriptionOptions contains the optional parameters for the EmailServicesClient.NewListBySubscriptionPager +// method. +type EmailServicesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// EmailServicesClientListVerifiedExchangeOnlineDomainsOptions contains the optional parameters for the EmailServicesClient.ListVerifiedExchangeOnlineDomains +// method. +type EmailServicesClientListVerifiedExchangeOnlineDomainsOptions struct { + // placeholder for future optional parameters +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// SenderUsernamesClientCreateOrUpdateOptions contains the optional parameters for the SenderUsernamesClient.CreateOrUpdate +// method. +type SenderUsernamesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// SenderUsernamesClientDeleteOptions contains the optional parameters for the SenderUsernamesClient.Delete method. +type SenderUsernamesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// SenderUsernamesClientGetOptions contains the optional parameters for the SenderUsernamesClient.Get method. +type SenderUsernamesClientGetOptions struct { + // placeholder for future optional parameters +} + +// SenderUsernamesClientListByDomainsOptions contains the optional parameters for the SenderUsernamesClient.NewListByDomainsPager +// method. +type SenderUsernamesClientListByDomainsOptions struct { + // placeholder for future optional parameters +} + +// ServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServicesClient.BeginCreateOrUpdate method. +type ServicesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServicesClientBeginDeleteOptions contains the optional parameters for the ServicesClient.BeginDelete method. +type ServicesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServicesClientCheckNameAvailabilityOptions contains the optional parameters for the ServicesClient.CheckNameAvailability +// method. +type ServicesClientCheckNameAvailabilityOptions struct { + // placeholder for future optional parameters +} + +// ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method. +type ServicesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServicesClientLinkNotificationHubOptions contains the optional parameters for the ServicesClient.LinkNotificationHub method. +type ServicesClientLinkNotificationHubOptions struct { + // Parameters supplied to the operation. + LinkNotificationHubParameters *LinkNotificationHubParameters +} + +// ServicesClientListByResourceGroupOptions contains the optional parameters for the ServicesClient.NewListByResourceGroupPager +// method. +type ServicesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ServicesClientListBySubscriptionOptions contains the optional parameters for the ServicesClient.NewListBySubscriptionPager +// method. +type ServicesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// ServicesClientListKeysOptions contains the optional parameters for the ServicesClient.ListKeys method. +type ServicesClientListKeysOptions struct { + // placeholder for future optional parameters +} + +// ServicesClientRegenerateKeyOptions contains the optional parameters for the ServicesClient.RegenerateKey method. +type ServicesClientRegenerateKeyOptions struct { + // placeholder for future optional parameters +} + +// ServicesClientUpdateOptions contains the optional parameters for the ServicesClient.Update method. +type ServicesClientUpdateOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/communication/armcommunication/response_types.go b/sdk/resourcemanager/communication/armcommunication/response_types.go index 2a3ec4f9e42c..82803f8cbad0 100644 --- a/sdk/resourcemanager/communication/armcommunication/response_types.go +++ b/sdk/resourcemanager/communication/armcommunication/response_types.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcommunication @@ -16,6 +15,7 @@ type DomainsClientCancelVerificationResponse struct { // DomainsClientCreateOrUpdateResponse contains the response from method DomainsClient.BeginCreateOrUpdate. type DomainsClientCreateOrUpdateResponse struct { + // A class representing a Domains resource. DomainResource } @@ -26,6 +26,7 @@ type DomainsClientDeleteResponse struct { // DomainsClientGetResponse contains the response from method DomainsClient.Get. type DomainsClientGetResponse struct { + // A class representing a Domains resource. DomainResource } @@ -36,16 +37,19 @@ type DomainsClientInitiateVerificationResponse struct { // DomainsClientListByEmailServiceResourceResponse contains the response from method DomainsClient.NewListByEmailServiceResourcePager. type DomainsClientListByEmailServiceResourceResponse struct { + // Object that includes an array of Domains resource and a possible link for next set. DomainResourceList } // DomainsClientUpdateResponse contains the response from method DomainsClient.BeginUpdate. type DomainsClientUpdateResponse struct { + // A class representing a Domains resource. DomainResource } // EmailServicesClientCreateOrUpdateResponse contains the response from method EmailServicesClient.BeginCreateOrUpdate. type EmailServicesClientCreateOrUpdateResponse struct { + // A class representing an EmailService resource. EmailServiceResource } @@ -56,16 +60,19 @@ type EmailServicesClientDeleteResponse struct { // EmailServicesClientGetResponse contains the response from method EmailServicesClient.Get. type EmailServicesClientGetResponse struct { + // A class representing an EmailService resource. EmailServiceResource } // EmailServicesClientListByResourceGroupResponse contains the response from method EmailServicesClient.NewListByResourceGroupPager. type EmailServicesClientListByResourceGroupResponse struct { + // Object that includes an array of EmailServices and a possible link for next set. EmailServiceResourceList } // EmailServicesClientListBySubscriptionResponse contains the response from method EmailServicesClient.NewListBySubscriptionPager. type EmailServicesClientListBySubscriptionResponse struct { + // Object that includes an array of EmailServices and a possible link for next set. EmailServiceResourceList } @@ -77,16 +84,19 @@ type EmailServicesClientListVerifiedExchangeOnlineDomainsResponse struct { // EmailServicesClientUpdateResponse contains the response from method EmailServicesClient.BeginUpdate. type EmailServicesClientUpdateResponse struct { + // A class representing an EmailService resource. EmailServiceResource } // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. OperationListResult } // SenderUsernamesClientCreateOrUpdateResponse contains the response from method SenderUsernamesClient.CreateOrUpdate. type SenderUsernamesClientCreateOrUpdateResponse struct { + // A class representing a SenderUsername resource. SenderUsernameResource } @@ -97,21 +107,25 @@ type SenderUsernamesClientDeleteResponse struct { // SenderUsernamesClientGetResponse contains the response from method SenderUsernamesClient.Get. type SenderUsernamesClientGetResponse struct { + // A class representing a SenderUsername resource. SenderUsernameResource } // SenderUsernamesClientListByDomainsResponse contains the response from method SenderUsernamesClient.NewListByDomainsPager. type SenderUsernamesClientListByDomainsResponse struct { + // A class representing a Domains SenderUsernames collection. SenderUsernameResourceCollection } // ServicesClientCheckNameAvailabilityResponse contains the response from method ServicesClient.CheckNameAvailability. type ServicesClientCheckNameAvailabilityResponse struct { + // The check availability result. CheckNameAvailabilityResponse } // ServicesClientCreateOrUpdateResponse contains the response from method ServicesClient.BeginCreateOrUpdate. type ServicesClientCreateOrUpdateResponse struct { + // A class representing a CommunicationService resource. ServiceResource } @@ -122,35 +136,42 @@ type ServicesClientDeleteResponse struct { // ServicesClientGetResponse contains the response from method ServicesClient.Get. type ServicesClientGetResponse struct { + // A class representing a CommunicationService resource. ServiceResource } // ServicesClientLinkNotificationHubResponse contains the response from method ServicesClient.LinkNotificationHub. type ServicesClientLinkNotificationHubResponse struct { + // A notification hub that has been linked to the communication service LinkedNotificationHub } // ServicesClientListByResourceGroupResponse contains the response from method ServicesClient.NewListByResourceGroupPager. type ServicesClientListByResourceGroupResponse struct { + // Object that includes an array of CommunicationServices and a possible link for next set. ServiceResourceList } // ServicesClientListBySubscriptionResponse contains the response from method ServicesClient.NewListBySubscriptionPager. type ServicesClientListBySubscriptionResponse struct { + // Object that includes an array of CommunicationServices and a possible link for next set. ServiceResourceList } // ServicesClientListKeysResponse contains the response from method ServicesClient.ListKeys. type ServicesClientListKeysResponse struct { + // A class representing the access keys of a CommunicationService. ServiceKeys } // ServicesClientRegenerateKeyResponse contains the response from method ServicesClient.RegenerateKey. type ServicesClientRegenerateKeyResponse struct { + // A class representing the access keys of a CommunicationService. ServiceKeys } // ServicesClientUpdateResponse contains the response from method ServicesClient.Update. type ServicesClientUpdateResponse struct { + // A class representing a CommunicationService resource. ServiceResource } diff --git a/sdk/resourcemanager/communication/armcommunication/senderusernames_client.go b/sdk/resourcemanager/communication/armcommunication/senderusernames_client.go index ff2e32aa563c..741b6f57a764 100644 --- a/sdk/resourcemanager/communication/armcommunication/senderusernames_client.go +++ b/sdk/resourcemanager/communication/armcommunication/senderusernames_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcommunication @@ -48,7 +47,7 @@ func NewSenderUsernamesClient(subscriptionID string, credential azcore.TokenCred // resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - emailServiceName - The name of the EmailService resource. // - domainName - The name of the Domains resource. @@ -57,18 +56,21 @@ func NewSenderUsernamesClient(subscriptionID string, credential azcore.TokenCred // - options - SenderUsernamesClientCreateOrUpdateOptions contains the optional parameters for the SenderUsernamesClient.CreateOrUpdate // method. func (client *SenderUsernamesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, emailServiceName string, domainName string, senderUsername string, parameters SenderUsernameResource, options *SenderUsernamesClientCreateOrUpdateOptions) (SenderUsernamesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, emailServiceName, domainName, senderUsername, parameters, options) if err != nil { return SenderUsernamesClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SenderUsernamesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return SenderUsernamesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return SenderUsernamesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -96,10 +98,13 @@ func (client *SenderUsernamesClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -114,23 +119,25 @@ func (client *SenderUsernamesClient) createOrUpdateHandleResponse(resp *http.Res // Delete - Operation to delete a SenderUsernames resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - emailServiceName - The name of the EmailService resource. // - domainName - The name of the Domains resource. // - senderUsername - The valid sender Username. // - options - SenderUsernamesClientDeleteOptions contains the optional parameters for the SenderUsernamesClient.Delete method. func (client *SenderUsernamesClient) Delete(ctx context.Context, resourceGroupName string, emailServiceName string, domainName string, senderUsername string, options *SenderUsernamesClientDeleteOptions) (SenderUsernamesClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, emailServiceName, domainName, senderUsername, options) if err != nil { return SenderUsernamesClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SenderUsernamesClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return SenderUsernamesClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return SenderUsernamesClientDeleteResponse{}, err } return SenderUsernamesClientDeleteResponse{}, nil } @@ -160,7 +167,7 @@ func (client *SenderUsernamesClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -169,25 +176,28 @@ func (client *SenderUsernamesClient) deleteCreateRequest(ctx context.Context, re // Get - Get a valid sender username for a domains resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - emailServiceName - The name of the EmailService resource. // - domainName - The name of the Domains resource. // - senderUsername - The valid sender Username. // - options - SenderUsernamesClientGetOptions contains the optional parameters for the SenderUsernamesClient.Get method. func (client *SenderUsernamesClient) Get(ctx context.Context, resourceGroupName string, emailServiceName string, domainName string, senderUsername string, options *SenderUsernamesClientGetOptions) (SenderUsernamesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, emailServiceName, domainName, senderUsername, options) if err != nil { return SenderUsernamesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SenderUsernamesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SenderUsernamesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SenderUsernamesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -215,7 +225,7 @@ func (client *SenderUsernamesClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,7 +242,7 @@ func (client *SenderUsernamesClient) getHandleResponse(resp *http.Response) (Sen // NewListByDomainsPager - List all valid sender usernames for a domains resource. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - emailServiceName - The name of the EmailService resource. // - domainName - The name of the Domains resource. @@ -287,7 +297,7 @@ func (client *SenderUsernamesClient) listByDomainsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/communication/armcommunication/senderusernames_client_example_test.go b/sdk/resourcemanager/communication/armcommunication/senderusernames_client_example_test.go index 9a16df057abb..c79b4121816d 100644 --- a/sdk/resourcemanager/communication/armcommunication/senderusernames_client_example_test.go +++ b/sdk/resourcemanager/communication/armcommunication/senderusernames_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/communication/armcommunication/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/senderUsernames/listByDomain.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/senderUsernames/listByDomain.json func ExampleSenderUsernamesClient_NewListByDomainsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +66,7 @@ func ExampleSenderUsernamesClient_NewListByDomainsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/senderUsernames/get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/senderUsernames/get.json func ExampleSenderUsernamesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -96,7 +96,7 @@ func ExampleSenderUsernamesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/senderUsernames/createOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/senderUsernames/createOrUpdate.json func ExampleSenderUsernamesClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -131,7 +131,7 @@ func ExampleSenderUsernamesClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/senderUsernames/delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/senderUsernames/delete.json func ExampleSenderUsernamesClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/communication/armcommunication/services_client.go b/sdk/resourcemanager/communication/armcommunication/services_client.go index e8b25ced9d23..6a848d7313bc 100644 --- a/sdk/resourcemanager/communication/armcommunication/services_client.go +++ b/sdk/resourcemanager/communication/armcommunication/services_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcommunication @@ -47,23 +46,26 @@ func NewServicesClient(subscriptionID string, credential azcore.TokenCredential, // CheckNameAvailability - Checks that the CommunicationService name is valid and is not already in use. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - nameAvailabilityParameters - Parameters supplied to the operation. // - options - ServicesClientCheckNameAvailabilityOptions contains the optional parameters for the ServicesClient.CheckNameAvailability // method. func (client *ServicesClient) CheckNameAvailability(ctx context.Context, nameAvailabilityParameters NameAvailabilityParameters, options *ServicesClientCheckNameAvailabilityOptions) (ServicesClientCheckNameAvailabilityResponse, error) { + var err error req, err := client.checkNameAvailabilityCreateRequest(ctx, nameAvailabilityParameters, options) if err != nil { return ServicesClientCheckNameAvailabilityResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServicesClientCheckNameAvailabilityResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServicesClientCheckNameAvailabilityResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServicesClientCheckNameAvailabilityResponse{}, err } - return client.checkNameAvailabilityHandleResponse(resp) + resp, err := client.checkNameAvailabilityHandleResponse(httpResp) + return resp, err } // checkNameAvailabilityCreateRequest creates the CheckNameAvailability request. @@ -75,10 +77,13 @@ func (client *ServicesClient) checkNameAvailabilityCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, nameAvailabilityParameters) + if err := runtime.MarshalAsJSON(req, nameAvailabilityParameters); err != nil { + return nil, err + } + return req, nil } // checkNameAvailabilityHandleResponse handles the CheckNameAvailability response. @@ -93,7 +98,7 @@ func (client *ServicesClient) checkNameAvailabilityHandleResponse(resp *http.Res // BeginCreateOrUpdate - Create a new CommunicationService or update an existing CommunicationService. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - communicationServiceName - The name of the CommunicationService resource. // - parameters - Parameters for the create or update operation @@ -105,9 +110,10 @@ func (client *ServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServicesClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServicesClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServicesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -116,20 +122,22 @@ func (client *ServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create a new CommunicationService or update an existing CommunicationService. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview func (client *ServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, communicationServiceName string, parameters ServiceResource, options *ServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, communicationServiceName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -149,16 +157,19 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Operation to delete a CommunicationService. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - communicationServiceName - The name of the CommunicationService resource. // - options - ServicesClientBeginDeleteOptions contains the optional parameters for the ServicesClient.BeginDelete method. @@ -168,9 +179,10 @@ func (client *ServicesClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServicesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServicesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServicesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -179,20 +191,22 @@ func (client *ServicesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Operation to delete a CommunicationService. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview func (client *ServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, communicationServiceName string, options *ServicesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, communicationServiceName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -212,7 +226,7 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -221,23 +235,26 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get the CommunicationService and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - communicationServiceName - The name of the CommunicationService resource. // - options - ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method. func (client *ServicesClient) Get(ctx context.Context, resourceGroupName string, communicationServiceName string, options *ServicesClientGetOptions) (ServicesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, communicationServiceName, options) if err != nil { return ServicesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServicesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServicesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServicesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -257,7 +274,7 @@ func (client *ServicesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -275,24 +292,27 @@ func (client *ServicesClient) getHandleResponse(resp *http.Response) (ServicesCl // LinkNotificationHub - Links an Azure Notification Hub to this communication service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - communicationServiceName - The name of the CommunicationService resource. // - options - ServicesClientLinkNotificationHubOptions contains the optional parameters for the ServicesClient.LinkNotificationHub // method. func (client *ServicesClient) LinkNotificationHub(ctx context.Context, resourceGroupName string, communicationServiceName string, options *ServicesClientLinkNotificationHubOptions) (ServicesClientLinkNotificationHubResponse, error) { + var err error req, err := client.linkNotificationHubCreateRequest(ctx, resourceGroupName, communicationServiceName, options) if err != nil { return ServicesClientLinkNotificationHubResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServicesClientLinkNotificationHubResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServicesClientLinkNotificationHubResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServicesClientLinkNotificationHubResponse{}, err } - return client.linkNotificationHubHandleResponse(resp) + resp, err := client.linkNotificationHubHandleResponse(httpResp) + return resp, err } // linkNotificationHubCreateRequest creates the LinkNotificationHub request. @@ -312,11 +332,14 @@ func (client *ServicesClient) linkNotificationHubCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.LinkNotificationHubParameters != nil { - return req, runtime.MarshalAsJSON(req, *options.LinkNotificationHubParameters) + if err := runtime.MarshalAsJSON(req, *options.LinkNotificationHubParameters); err != nil { + return nil, err + } + return req, nil } return req, nil } @@ -332,7 +355,7 @@ func (client *ServicesClient) linkNotificationHubHandleResponse(resp *http.Respo // NewListByResourceGroupPager - Handles requests to list all resources in a resource group. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ServicesClientListByResourceGroupOptions contains the optional parameters for the ServicesClient.NewListByResourceGroupPager // method. @@ -377,7 +400,7 @@ func (client *ServicesClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -394,7 +417,7 @@ func (client *ServicesClient) listByResourceGroupHandleResponse(resp *http.Respo // NewListBySubscriptionPager - Handles requests to list all resources in a subscription. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - options - ServicesClientListBySubscriptionOptions contains the optional parameters for the ServicesClient.NewListBySubscriptionPager // method. func (client *ServicesClient) NewListBySubscriptionPager(options *ServicesClientListBySubscriptionOptions) *runtime.Pager[ServicesClientListBySubscriptionResponse] { @@ -434,7 +457,7 @@ func (client *ServicesClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -452,23 +475,26 @@ func (client *ServicesClient) listBySubscriptionHandleResponse(resp *http.Respon // ListKeys - Get the access keys of the CommunicationService resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - communicationServiceName - The name of the CommunicationService resource. // - options - ServicesClientListKeysOptions contains the optional parameters for the ServicesClient.ListKeys method. func (client *ServicesClient) ListKeys(ctx context.Context, resourceGroupName string, communicationServiceName string, options *ServicesClientListKeysOptions) (ServicesClientListKeysResponse, error) { + var err error req, err := client.listKeysCreateRequest(ctx, resourceGroupName, communicationServiceName, options) if err != nil { return ServicesClientListKeysResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServicesClientListKeysResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServicesClientListKeysResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServicesClientListKeysResponse{}, err } - return client.listKeysHandleResponse(resp) + resp, err := client.listKeysHandleResponse(httpResp) + return resp, err } // listKeysCreateRequest creates the ListKeys request. @@ -488,7 +514,7 @@ func (client *ServicesClient) listKeysCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -507,24 +533,27 @@ func (client *ServicesClient) listKeysHandleResponse(resp *http.Response) (Servi // time. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - communicationServiceName - The name of the CommunicationService resource. // - parameters - Parameter that describes the Regenerate Key Operation. // - options - ServicesClientRegenerateKeyOptions contains the optional parameters for the ServicesClient.RegenerateKey method. func (client *ServicesClient) RegenerateKey(ctx context.Context, resourceGroupName string, communicationServiceName string, parameters RegenerateKeyParameters, options *ServicesClientRegenerateKeyOptions) (ServicesClientRegenerateKeyResponse, error) { + var err error req, err := client.regenerateKeyCreateRequest(ctx, resourceGroupName, communicationServiceName, parameters, options) if err != nil { return ServicesClientRegenerateKeyResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServicesClientRegenerateKeyResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServicesClientRegenerateKeyResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServicesClientRegenerateKeyResponse{}, err } - return client.regenerateKeyHandleResponse(resp) + resp, err := client.regenerateKeyHandleResponse(httpResp) + return resp, err } // regenerateKeyCreateRequest creates the RegenerateKey request. @@ -544,10 +573,13 @@ func (client *ServicesClient) regenerateKeyCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // regenerateKeyHandleResponse handles the RegenerateKey response. @@ -562,24 +594,27 @@ func (client *ServicesClient) regenerateKeyHandleResponse(resp *http.Response) ( // Update - Operation to update an existing CommunicationService. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-31 +// Generated from API version 2023-04-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - communicationServiceName - The name of the CommunicationService resource. // - parameters - Parameters for the update operation // - options - ServicesClientUpdateOptions contains the optional parameters for the ServicesClient.Update method. func (client *ServicesClient) Update(ctx context.Context, resourceGroupName string, communicationServiceName string, parameters ServiceResourceUpdate, options *ServicesClientUpdateOptions) (ServicesClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, communicationServiceName, parameters, options) if err != nil { return ServicesClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServicesClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServicesClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServicesClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -599,10 +634,13 @@ func (client *ServicesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-31") + reqQP.Set("api-version", "2023-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/communication/armcommunication/services_client_example_test.go b/sdk/resourcemanager/communication/armcommunication/services_client_example_test.go index 3b268270688e..fb2d6d92f61a 100644 --- a/sdk/resourcemanager/communication/armcommunication/services_client_example_test.go +++ b/sdk/resourcemanager/communication/armcommunication/services_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/communication/armcommunication/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/communicationServices/checkNameAvailabilityAvailable.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/checkNameAvailabilityAvailable.json func ExampleServicesClient_CheckNameAvailability_checkNameAvailabilityAvailable() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -46,7 +46,7 @@ func ExampleServicesClient_CheckNameAvailability_checkNameAvailabilityAvailable( // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/communicationServices/checkNameAvailabilityUnavailable.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/checkNameAvailabilityUnavailable.json func ExampleServicesClient_CheckNameAvailability_checkNameAvailabilityUnavailable() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -74,7 +74,7 @@ func ExampleServicesClient_CheckNameAvailability_checkNameAvailabilityUnavailabl // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/communicationServices/linkNotificationHub.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/linkNotificationHub.json func ExampleServicesClient_LinkNotificationHub() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -101,7 +101,7 @@ func ExampleServicesClient_LinkNotificationHub() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/communicationServices/listBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/listBySubscription.json func ExampleServicesClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -141,7 +141,7 @@ func ExampleServicesClient_NewListBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/communicationServices/listByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/listByResourceGroup.json func ExampleServicesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -181,8 +181,8 @@ func ExampleServicesClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/communicationServices/update.json -func ExampleServicesClient_Update() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/update.json +func ExampleServicesClient_Update_updateResource() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -211,6 +211,166 @@ func ExampleServicesClient_Update() { // Tags: map[string]*string{ // "newTag": to.Ptr("newVal"), // }, + // Identity: &armcommunication.ManagedServiceIdentity{ + // Type: to.Ptr(armcommunication.ManagedServiceIdentityTypeNone), + // }, + // Properties: &armcommunication.ServiceProperties{ + // DataLocation: to.Ptr("United States"), + // HostName: to.Ptr("mycommunicationresource.communications.azure.com"), + // ProvisioningState: to.Ptr(armcommunication.CommunicationServicesProvisioningStateSucceeded), + // Version: to.Ptr("0.2.0"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/updateWithSystemAndUserIdentity.json +func ExampleServicesClient_Update_updateResourceToAddSystemAndUserManagedIdentities() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcommunication.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewServicesClient().Update(ctx, "MyResourceGroup", "MyCommunicationResource", armcommunication.ServiceResourceUpdate{ + Tags: map[string]*string{ + "newTag": to.Ptr("newVal"), + }, + Identity: &armcommunication.ManagedServiceIdentity{ + Type: to.Ptr(armcommunication.ManagedServiceIdentityTypeSystemAssignedUserAssigned), + UserAssignedIdentities: map[string]*armcommunication.UserAssignedIdentity{ + "/user/assigned/resource/id": {}, + }, + }, + }, 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.ServiceResource = armcommunication.ServiceResource{ + // Name: to.Ptr("MyCommunicationResource"), + // Type: to.Ptr("Microsoft.Communication/CommunicationServices"), + // ID: to.Ptr("/subscriptions/11112222-3333-4444-5555-666677778888/resourceGroups/MyResourceGroup/providers/Microsoft.Communication/CommunicationServices/MyCommunicationResource"), + // Location: to.Ptr("Global"), + // Tags: map[string]*string{ + // "newTag": to.Ptr("newVal"), + // }, + // Identity: &armcommunication.ManagedServiceIdentity{ + // Type: to.Ptr(armcommunication.ManagedServiceIdentityTypeSystemAssignedUserAssigned), + // PrincipalID: to.Ptr("11111111-1111-1111-1111-111111111111"), + // TenantID: to.Ptr("22222222-2222-2222-2222-222222222222"), + // UserAssignedIdentities: map[string]*armcommunication.UserAssignedIdentity{ + // "/user/assigned/resource/id": &armcommunication.UserAssignedIdentity{ + // ClientID: to.Ptr("11112222-3333-4444-5555-666677778888"), + // PrincipalID: to.Ptr("11112222-3333-4444-5555-666677778888"), + // }, + // }, + // }, + // Properties: &armcommunication.ServiceProperties{ + // DataLocation: to.Ptr("United States"), + // HostName: to.Ptr("mycommunicationresource.communications.azure.com"), + // ProvisioningState: to.Ptr(armcommunication.CommunicationServicesProvisioningStateSucceeded), + // Version: to.Ptr("0.2.0"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/updateWithSystemAssignedIdentity.json +func ExampleServicesClient_Update_updateResourceToAddASystemAssignedManagedIdentity() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcommunication.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewServicesClient().Update(ctx, "MyResourceGroup", "MyCommunicationResource", armcommunication.ServiceResourceUpdate{ + Tags: map[string]*string{ + "newTag": to.Ptr("newVal"), + }, + Identity: &armcommunication.ManagedServiceIdentity{ + Type: to.Ptr(armcommunication.ManagedServiceIdentityTypeSystemAssigned), + }, + }, 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.ServiceResource = armcommunication.ServiceResource{ + // Name: to.Ptr("MyCommunicationResource"), + // Type: to.Ptr("Microsoft.Communication/CommunicationServices"), + // ID: to.Ptr("/subscriptions/11112222-3333-4444-5555-666677778888/resourceGroups/MyResourceGroup/providers/Microsoft.Communication/CommunicationServices/MyCommunicationResource"), + // Location: to.Ptr("Global"), + // Tags: map[string]*string{ + // "newTag": to.Ptr("newVal"), + // }, + // Identity: &armcommunication.ManagedServiceIdentity{ + // Type: to.Ptr(armcommunication.ManagedServiceIdentityTypeSystemAssigned), + // PrincipalID: to.Ptr("11111111-1111-1111-1111-111111111111"), + // TenantID: to.Ptr("22222222-2222-2222-2222-222222222222"), + // }, + // Properties: &armcommunication.ServiceProperties{ + // DataLocation: to.Ptr("United States"), + // HostName: to.Ptr("mycommunicationresource.communications.azure.com"), + // ProvisioningState: to.Ptr(armcommunication.CommunicationServicesProvisioningStateSucceeded), + // Version: to.Ptr("0.2.0"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/updateWithUserAssignedIdentity.json +func ExampleServicesClient_Update_updateResourceToAddAUserAssignedManagedIdentity() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcommunication.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewServicesClient().Update(ctx, "MyResourceGroup", "MyCommunicationResource", armcommunication.ServiceResourceUpdate{ + Tags: map[string]*string{ + "newTag": to.Ptr("newVal"), + }, + Identity: &armcommunication.ManagedServiceIdentity{ + Type: to.Ptr(armcommunication.ManagedServiceIdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armcommunication.UserAssignedIdentity{ + "/user/assigned/resource/id": {}, + }, + }, + }, 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.ServiceResource = armcommunication.ServiceResource{ + // Name: to.Ptr("MyCommunicationResource"), + // Type: to.Ptr("Microsoft.Communication/CommunicationServices"), + // ID: to.Ptr("/subscriptions/11112222-3333-4444-5555-666677778888/resourceGroups/MyResourceGroup/providers/Microsoft.Communication/CommunicationServices/MyCommunicationResource"), + // Location: to.Ptr("Global"), + // Tags: map[string]*string{ + // "newTag": to.Ptr("newVal"), + // }, + // Identity: &armcommunication.ManagedServiceIdentity{ + // Type: to.Ptr(armcommunication.ManagedServiceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armcommunication.UserAssignedIdentity{ + // "/user/assigned/resource/id": &armcommunication.UserAssignedIdentity{ + // ClientID: to.Ptr("11112222-3333-4444-5555-666677778888"), + // PrincipalID: to.Ptr("11112222-3333-4444-5555-666677778888"), + // }, + // }, + // }, // Properties: &armcommunication.ServiceProperties{ // DataLocation: to.Ptr("United States"), // HostName: to.Ptr("mycommunicationresource.communications.azure.com"), @@ -220,7 +380,48 @@ func ExampleServicesClient_Update() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/communicationServices/get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/updateRemoveSystemIdentity.json +func ExampleServicesClient_Update_updateResourceToRemoveIdentity() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcommunication.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewServicesClient().Update(ctx, "MyResourceGroup", "MyCommunicationResource", armcommunication.ServiceResourceUpdate{ + Tags: map[string]*string{ + "newTag": to.Ptr("newVal"), + }, + Identity: &armcommunication.ManagedServiceIdentity{ + Type: to.Ptr(armcommunication.ManagedServiceIdentityTypeNone), + }, + }, 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.ServiceResource = armcommunication.ServiceResource{ + // Name: to.Ptr("MyCommunicationResource"), + // Type: to.Ptr("Microsoft.Communication/CommunicationServices"), + // ID: to.Ptr("/subscriptions/11112222-3333-4444-5555-666677778888/resourceGroups/MyResourceGroup/providers/Microsoft.Communication/CommunicationServices/MyCommunicationResource"), + // Location: to.Ptr("Global"), + // Tags: map[string]*string{ + // "newTag": to.Ptr("newVal"), + // }, + // Properties: &armcommunication.ServiceProperties{ + // DataLocation: to.Ptr("United States"), + // HostName: to.Ptr("mycommunicationresource.communication.azure.com"), + // ProvisioningState: to.Ptr(armcommunication.CommunicationServicesProvisioningStateSucceeded), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/get.json func ExampleServicesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -243,6 +444,11 @@ func ExampleServicesClient_Get() { // Type: to.Ptr("Microsoft.Communication/CommunicationServices"), // ID: to.Ptr("/subscriptions/11112222-3333-4444-5555-666677778888/resourceGroups/MyResourceGroup/providers/Microsoft.Communication/CommunicationServices/MyCommunicationResource"), // Location: to.Ptr("Global"), + // Identity: &armcommunication.ManagedServiceIdentity{ + // Type: to.Ptr(armcommunication.ManagedServiceIdentityTypeSystemAssigned), + // PrincipalID: to.Ptr("11111111-1111-1111-1111-111111111111"), + // TenantID: to.Ptr("22222222-2222-2222-2222-222222222222"), + // }, // Properties: &armcommunication.ServiceProperties{ // DataLocation: to.Ptr("United States"), // HostName: to.Ptr("mycommunicationservice.comms.azure.net"), @@ -252,8 +458,8 @@ func ExampleServicesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/communicationServices/createOrUpdate.json -func ExampleServicesClient_BeginCreateOrUpdate() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/createOrUpdate.json +func ExampleServicesClient_BeginCreateOrUpdate_createOrUpdateResource() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -284,6 +490,57 @@ func ExampleServicesClient_BeginCreateOrUpdate() { // Type: to.Ptr("Microsoft.Communication/CommunicationServices"), // ID: to.Ptr("/subscriptions/11112222-3333-4444-5555-666677778888/resourceGroups/MyResourceGroup/providers/Microsoft.Communication/CommunicationServices/MyCommunicationResource"), // Location: to.Ptr("Global"), + // Identity: &armcommunication.ManagedServiceIdentity{ + // Type: to.Ptr(armcommunication.ManagedServiceIdentityTypeNone), + // }, + // Properties: &armcommunication.ServiceProperties{ + // DataLocation: to.Ptr("United States"), + // HostName: to.Ptr("mycommunicationresource.communications.azure.com"), + // ProvisioningState: to.Ptr(armcommunication.CommunicationServicesProvisioningStateSucceeded), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/createOrUpdateWithSystemAssignedIdentity.json +func ExampleServicesClient_BeginCreateOrUpdate_createOrUpdateResourceWithManagedIdentity() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcommunication.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "MyResourceGroup", "MyCommunicationResource", armcommunication.ServiceResource{ + Location: to.Ptr("Global"), + Identity: &armcommunication.ManagedServiceIdentity{ + Type: to.Ptr(armcommunication.ManagedServiceIdentityTypeSystemAssigned), + }, + Properties: &armcommunication.ServiceProperties{ + DataLocation: to.Ptr("United States"), + }, + }, 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.ServiceResource = armcommunication.ServiceResource{ + // Name: to.Ptr("MyCommunicationResource"), + // Type: to.Ptr("Microsoft.Communication/CommunicationServices"), + // ID: to.Ptr("/subscriptions/11112222-3333-4444-5555-666677778888/resourceGroups/MyResourceGroup/providers/Microsoft.Communication/CommunicationServices/MyCommunicationResource"), + // Location: to.Ptr("Global"), + // Identity: &armcommunication.ManagedServiceIdentity{ + // Type: to.Ptr(armcommunication.ManagedServiceIdentityTypeSystemAssigned), + // PrincipalID: to.Ptr("11111111-1111-1111-1111-111111111111"), + // TenantID: to.Ptr("22222222-2222-2222-2222-222222222222"), + // }, // Properties: &armcommunication.ServiceProperties{ // DataLocation: to.Ptr("United States"), // HostName: to.Ptr("mycommunicationresource.communications.azure.com"), @@ -292,7 +549,7 @@ func ExampleServicesClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/communicationServices/delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/delete.json func ExampleServicesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -313,7 +570,7 @@ func ExampleServicesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/communicationServices/listKeys.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/listKeys.json func ExampleServicesClient_ListKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -337,7 +594,7 @@ func ExampleServicesClient_ListKeys() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/06042d4ffed6a1ea8319c39cd07ea21efe5d49f7/specification/communication/resource-manager/Microsoft.Communication/stable/2023-03-31/examples/communicationServices/regenerateKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d7b535d1273b18623ca0d63a6ebb0456dab95ba/specification/communication/resource-manager/Microsoft.Communication/preview/2023-04-01-preview/examples/communicationServices/regenerateKey.json func ExampleServicesClient_RegenerateKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/communication/armcommunication/time_rfc3339.go b/sdk/resourcemanager/communication/armcommunication/time_rfc3339.go index b0e1cad03299..773832e9f38d 100644 --- a/sdk/resourcemanager/communication/armcommunication/time_rfc3339.go +++ b/sdk/resourcemanager/communication/armcommunication/time_rfc3339.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcommunication