diff --git a/sdk/resourcemanager/signalr/armsignalr/CHANGELOG.md b/sdk/resourcemanager/signalr/armsignalr/CHANGELOG.md index 34ac19703899..8623f49aea26 100644 --- a/sdk/resourcemanager/signalr/armsignalr/CHANGELOG.md +++ b/sdk/resourcemanager/signalr/armsignalr/CHANGELOG.md @@ -1,5 +1,449 @@ # Release History +## 0.2.0 (2022-01-21) +### Breaking Changes + +- Function `*UsagesClient.List` parameter(s) have been changed from `(string, *UsagesListOptions)` to `(string, *UsagesClientListOptions)` +- Function `*UsagesClient.List` return value(s) have been changed from `(*UsagesListPager)` to `(*UsagesClientListPager)` +- Function `*OperationsClient.List` parameter(s) have been changed from `(*OperationsListOptions)` to `(*OperationsClientListOptions)` +- Function `*OperationsClient.List` return value(s) have been changed from `(*OperationsListPager)` to `(*OperationsClientListPager)` +- Function `*SignalRRestartPoller.ResumeToken` has been removed +- Function `SignalRRegenerateKeyPollerResponse.PollUntilDone` has been removed +- Function `SignalRUpdatePollerResponse.PollUntilDone` has been removed +- Function `SignalRNetworkACLs.MarshalJSON` has been removed +- Function `*SignalRClient.BeginRegenerateKey` has been removed +- Function `*SignalRRegenerateKeyPollerResponse.Resume` has been removed +- Function `*SignalRClient.ListSKUs` has been removed +- Function `*SignalRPrivateLinkResourcesClient.List` has been removed +- Function `*SignalRPrivateEndpointConnectionsClient.List` has been removed +- Function `*SignalRCreateOrUpdatePoller.Done` has been removed +- Function `*SignalRPrivateEndpointConnectionsDeletePoller.ResumeToken` has been removed +- Function `*SignalRSharedPrivateLinkResourcesDeletePoller.ResumeToken` has been removed +- Function `*SignalRCreateOrUpdatePoller.FinalResponse` has been removed +- Function `*SignalRRegenerateKeyPoller.ResumeToken` has been removed +- Function `*SignalRSharedPrivateLinkResourcesDeletePollerResponse.Resume` has been removed +- Function `*SignalRListByResourceGroupPager.PageResponse` has been removed +- Function `PrivateEndpointConnection.MarshalJSON` has been removed +- Function `NewSignalRClient` has been removed +- Function `*SignalRClient.ListBySubscription` has been removed +- Function `*SignalRSharedPrivateLinkResourcesListPager.NextPage` has been removed +- Function `*SignalRRegenerateKeyPoller.FinalResponse` has been removed +- Function `*SignalRDeletePoller.Poll` has been removed +- Function `*SignalRSharedPrivateLinkResourcesCreateOrUpdatePoller.Poll` has been removed +- Function `*OperationsListPager.Err` has been removed +- Function `SignalRResource.MarshalJSON` has been removed +- Function `SignalRUsageList.MarshalJSON` has been removed +- Function `*SignalRRegenerateKeyPoller.Done` has been removed +- Function `*SignalRPrivateEndpointConnectionsListPager.Err` has been removed +- Function `*SignalRSharedPrivateLinkResourcesCreateOrUpdatePoller.ResumeToken` has been removed +- Function `*SignalRListBySubscriptionPager.NextPage` has been removed +- Function `SignalRSharedPrivateLinkResourcesDeletePollerResponse.PollUntilDone` has been removed +- Function `Resource.MarshalJSON` has been removed +- Function `*SignalRUpdatePollerResponse.Resume` has been removed +- Function `*SignalRPrivateEndpointConnectionsDeletePollerResponse.Resume` has been removed +- Function `*SignalRCreateOrUpdatePoller.ResumeToken` has been removed +- Function `PrivateLinkResource.MarshalJSON` has been removed +- Function `*SignalRUpdatePoller.Done` has been removed +- Function `SignalRCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `SignalRCorsSettings.MarshalJSON` has been removed +- Function `SharedPrivateLinkResource.MarshalJSON` has been removed +- Function `*SignalRPrivateLinkResourcesListPager.NextPage` has been removed +- Function `*SignalRUpdatePoller.Poll` has been removed +- Function `NewSignalRPrivateLinkResourcesClient` has been removed +- Function `*SignalRUpdatePoller.ResumeToken` has been removed +- Function `*SignalRPrivateEndpointConnectionsClient.Update` has been removed +- Function `ErrorResponse.Error` has been removed +- Function `SignalRResourceList.MarshalJSON` has been removed +- Function `*SignalRSharedPrivateLinkResourcesDeletePoller.FinalResponse` has been removed +- Function `*SignalRSharedPrivateLinkResourcesCreateOrUpdatePoller.Done` has been removed +- Function `*SignalRDeletePoller.FinalResponse` has been removed +- Function `*SignalRPrivateEndpointConnectionsClient.Get` has been removed +- Function `*SignalRRestartPoller.FinalResponse` has been removed +- Function `*SignalRPrivateLinkResourcesListPager.Err` has been removed +- Function `*SignalRSharedPrivateLinkResourcesListPager.PageResponse` has been removed +- Function `*SignalRListBySubscriptionPager.Err` has been removed +- Function `NewSignalRSharedPrivateLinkResourcesClient` has been removed +- Function `SignalRSharedPrivateLinkResourcesCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `*SignalRSharedPrivateLinkResourcesClient.BeginCreateOrUpdate` has been removed +- Function `*SignalRListByResourceGroupPager.Err` has been removed +- Function `*SignalRPrivateEndpointConnectionsListPager.PageResponse` has been removed +- Function `*SignalRPrivateEndpointConnectionsDeletePoller.Done` has been removed +- Function `*SignalRPrivateLinkResourcesListPager.PageResponse` has been removed +- Function `*SignalRClient.BeginCreateOrUpdate` has been removed +- Function `*SignalRSharedPrivateLinkResourcesListPager.Err` has been removed +- Function `*SignalRDeletePollerResponse.Resume` has been removed +- Function `*SignalRPrivateEndpointConnectionsDeletePoller.FinalResponse` has been removed +- Function `ErrorDetail.MarshalJSON` has been removed +- Function `*SignalRClient.CheckNameAvailability` has been removed +- Function `*SignalRClient.BeginRestart` has been removed +- Function `SignalRProperties.MarshalJSON` has been removed +- Function `NewSignalRPrivateEndpointConnectionsClient` has been removed +- Function `*SignalRPrivateEndpointConnectionsListPager.NextPage` has been removed +- Function `*SignalRRestartPollerResponse.Resume` has been removed +- Function `*SignalRListBySubscriptionPager.PageResponse` has been removed +- Function `*SignalRPrivateEndpointConnectionsDeletePoller.Poll` has been removed +- Function `*SignalRRestartPoller.Done` has been removed +- Function `*SignalRClient.ListKeys` has been removed +- Function `*SignalRSharedPrivateLinkResourcesClient.List` has been removed +- Function `*SignalRSharedPrivateLinkResourcesClient.BeginDelete` has been removed +- Function `*SignalRPrivateEndpointConnectionsClient.BeginDelete` has been removed +- Function `*SignalRClient.BeginUpdate` has been removed +- Function `*SignalRCreateOrUpdatePollerResponse.Resume` has been removed +- Function `*OperationsListPager.NextPage` has been removed +- Function `*SignalRUpdatePoller.FinalResponse` has been removed +- Function `*SignalRSharedPrivateLinkResourcesCreateOrUpdatePollerResponse.Resume` has been removed +- Function `*SignalRDeletePoller.Done` has been removed +- Function `*SignalRRegenerateKeyPoller.Poll` has been removed +- Function `*UsagesListPager.NextPage` has been removed +- Function `SignalRRestartPollerResponse.PollUntilDone` has been removed +- Function `*UsagesListPager.PageResponse` has been removed +- Function `*SignalRClient.ListByResourceGroup` has been removed +- Function `*SignalRCreateOrUpdatePoller.Poll` has been removed +- Function `*SignalRClient.Get` has been removed +- Function `*SignalRDeletePoller.ResumeToken` has been removed +- Function `SignalRPrivateEndpointConnectionsDeletePollerResponse.PollUntilDone` has been removed +- Function `*SignalRSharedPrivateLinkResourcesDeletePoller.Done` has been removed +- Function `*SignalRSharedPrivateLinkResourcesDeletePoller.Poll` has been removed +- Function `*UsagesListPager.Err` has been removed +- Function `SignalRFeature.MarshalJSON` has been removed +- Function `SignalRDeletePollerResponse.PollUntilDone` has been removed +- Function `*SignalRListByResourceGroupPager.NextPage` has been removed +- Function `*SignalRSharedPrivateLinkResourcesCreateOrUpdatePoller.FinalResponse` has been removed +- Function `*SignalRSharedPrivateLinkResourcesClient.Get` has been removed +- Function `*OperationsListPager.PageResponse` has been removed +- Function `*SignalRClient.BeginDelete` has been removed +- Function `*SignalRRestartPoller.Poll` has been removed +- Struct `ErrorAdditionalInfo` has been removed +- Struct `ErrorDetail` has been removed +- Struct `ErrorResponse` has been removed +- Struct `OperationsListOptions` has been removed +- Struct `OperationsListPager` has been removed +- Struct `OperationsListResponse` has been removed +- Struct `OperationsListResult` has been removed +- Struct `SignalRBeginCreateOrUpdateOptions` has been removed +- Struct `SignalRBeginDeleteOptions` has been removed +- Struct `SignalRBeginRegenerateKeyOptions` has been removed +- Struct `SignalRBeginRestartOptions` has been removed +- Struct `SignalRBeginUpdateOptions` has been removed +- Struct `SignalRCheckNameAvailabilityOptions` has been removed +- Struct `SignalRCheckNameAvailabilityResponse` has been removed +- Struct `SignalRCheckNameAvailabilityResult` has been removed +- Struct `SignalRClient` has been removed +- Struct `SignalRCorsSettings` has been removed +- Struct `SignalRCreateOrUpdatePoller` has been removed +- Struct `SignalRCreateOrUpdatePollerResponse` has been removed +- Struct `SignalRCreateOrUpdateResponse` has been removed +- Struct `SignalRCreateOrUpdateResult` has been removed +- Struct `SignalRDeletePoller` has been removed +- Struct `SignalRDeletePollerResponse` has been removed +- Struct `SignalRDeleteResponse` has been removed +- Struct `SignalRFeature` has been removed +- Struct `SignalRGetOptions` has been removed +- Struct `SignalRGetResponse` has been removed +- Struct `SignalRGetResult` has been removed +- Struct `SignalRKeys` has been removed +- Struct `SignalRListByResourceGroupOptions` has been removed +- Struct `SignalRListByResourceGroupPager` has been removed +- Struct `SignalRListByResourceGroupResponse` has been removed +- Struct `SignalRListByResourceGroupResult` has been removed +- Struct `SignalRListBySubscriptionOptions` has been removed +- Struct `SignalRListBySubscriptionPager` has been removed +- Struct `SignalRListBySubscriptionResponse` has been removed +- Struct `SignalRListBySubscriptionResult` has been removed +- Struct `SignalRListKeysOptions` has been removed +- Struct `SignalRListKeysResponse` has been removed +- Struct `SignalRListKeysResult` has been removed +- Struct `SignalRListSKUsOptions` has been removed +- Struct `SignalRListSKUsResponse` has been removed +- Struct `SignalRListSKUsResult` has been removed +- Struct `SignalRNetworkACLs` has been removed +- Struct `SignalRPrivateEndpointConnectionsBeginDeleteOptions` has been removed +- Struct `SignalRPrivateEndpointConnectionsClient` has been removed +- Struct `SignalRPrivateEndpointConnectionsDeletePoller` has been removed +- Struct `SignalRPrivateEndpointConnectionsDeletePollerResponse` has been removed +- Struct `SignalRPrivateEndpointConnectionsDeleteResponse` has been removed +- Struct `SignalRPrivateEndpointConnectionsGetOptions` has been removed +- Struct `SignalRPrivateEndpointConnectionsGetResponse` has been removed +- Struct `SignalRPrivateEndpointConnectionsGetResult` has been removed +- Struct `SignalRPrivateEndpointConnectionsListOptions` has been removed +- Struct `SignalRPrivateEndpointConnectionsListPager` has been removed +- Struct `SignalRPrivateEndpointConnectionsListResponse` has been removed +- Struct `SignalRPrivateEndpointConnectionsListResult` has been removed +- Struct `SignalRPrivateEndpointConnectionsUpdateOptions` has been removed +- Struct `SignalRPrivateEndpointConnectionsUpdateResponse` has been removed +- Struct `SignalRPrivateEndpointConnectionsUpdateResult` has been removed +- Struct `SignalRPrivateLinkResourcesClient` has been removed +- Struct `SignalRPrivateLinkResourcesListOptions` has been removed +- Struct `SignalRPrivateLinkResourcesListPager` has been removed +- Struct `SignalRPrivateLinkResourcesListResponse` has been removed +- Struct `SignalRPrivateLinkResourcesListResult` has been removed +- Struct `SignalRProperties` has been removed +- Struct `SignalRRegenerateKeyPoller` has been removed +- Struct `SignalRRegenerateKeyPollerResponse` has been removed +- Struct `SignalRRegenerateKeyResponse` has been removed +- Struct `SignalRRegenerateKeyResult` has been removed +- Struct `SignalRResource` has been removed +- Struct `SignalRResourceList` has been removed +- Struct `SignalRRestartPoller` has been removed +- Struct `SignalRRestartPollerResponse` has been removed +- Struct `SignalRRestartResponse` has been removed +- Struct `SignalRSharedPrivateLinkResourcesBeginCreateOrUpdateOptions` has been removed +- Struct `SignalRSharedPrivateLinkResourcesBeginDeleteOptions` has been removed +- Struct `SignalRSharedPrivateLinkResourcesClient` has been removed +- Struct `SignalRSharedPrivateLinkResourcesCreateOrUpdatePoller` has been removed +- Struct `SignalRSharedPrivateLinkResourcesCreateOrUpdatePollerResponse` has been removed +- Struct `SignalRSharedPrivateLinkResourcesCreateOrUpdateResponse` has been removed +- Struct `SignalRSharedPrivateLinkResourcesCreateOrUpdateResult` has been removed +- Struct `SignalRSharedPrivateLinkResourcesDeletePoller` has been removed +- Struct `SignalRSharedPrivateLinkResourcesDeletePollerResponse` has been removed +- Struct `SignalRSharedPrivateLinkResourcesDeleteResponse` has been removed +- Struct `SignalRSharedPrivateLinkResourcesGetOptions` has been removed +- Struct `SignalRSharedPrivateLinkResourcesGetResponse` has been removed +- Struct `SignalRSharedPrivateLinkResourcesGetResult` has been removed +- Struct `SignalRSharedPrivateLinkResourcesListOptions` has been removed +- Struct `SignalRSharedPrivateLinkResourcesListPager` has been removed +- Struct `SignalRSharedPrivateLinkResourcesListResponse` has been removed +- Struct `SignalRSharedPrivateLinkResourcesListResult` has been removed +- Struct `SignalRTLSSettings` has been removed +- Struct `SignalRUpdatePoller` has been removed +- Struct `SignalRUpdatePollerResponse` has been removed +- Struct `SignalRUpdateResponse` has been removed +- Struct `SignalRUpdateResult` has been removed +- Struct `SignalRUsage` has been removed +- Struct `SignalRUsageList` has been removed +- Struct `SignalRUsageName` has been removed +- Struct `UsagesListOptions` has been removed +- Struct `UsagesListPager` has been removed +- Struct `UsagesListResponse` has been removed +- Struct `UsagesListResult` has been removed +- Field `ProxyResource` of struct `SharedPrivateLinkResource` has been removed +- Field `Resource` of struct `ProxyResource` has been removed +- Field `ProxyResource` of struct `PrivateLinkResource` has been removed +- Field `ProxyResource` of struct `PrivateEndpointConnection` has been removed +- Field `Resource` of struct `TrackedResource` has been removed +- Field `NetworkACL` of struct `PrivateEndpointACL` has been removed + +### Features Added + +- New function `*ClientUpdatePollerResponse.Resume(context.Context, *Client, string) error` +- New function `NewPrivateLinkResourcesClient(string, azcore.TokenCredential, *arm.ClientOptions) *PrivateLinkResourcesClient` +- New function `*SharedPrivateLinkResourcesClientDeletePoller.ResumeToken() (string, error)` +- New function `SharedPrivateLinkResourcesClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (SharedPrivateLinkResourcesClientDeleteResponse, error)` +- New function `*ClientRestartPoller.Poll(context.Context) (*http.Response, error)` +- New function `*ClientRegenerateKeyPoller.ResumeToken() (string, error)` +- New function `*ClientUpdatePoller.FinalResponse(context.Context) (ClientUpdateResponse, error)` +- New function `*PrivateLinkResourcesClient.List(string, string, *PrivateLinkResourcesClientListOptions) *PrivateLinkResourcesClientListPager` +- New function `*SharedPrivateLinkResourcesClientCreateOrUpdatePoller.Done() bool` +- New function `ClientCreateOrUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (ClientCreateOrUpdateResponse, error)` +- New function `*ClientUpdatePoller.Poll(context.Context) (*http.Response, error)` +- New function `Feature.MarshalJSON() ([]byte, error)` +- New function `ResourceInfo.MarshalJSON() ([]byte, error)` +- New function `*ClientRestartPoller.FinalResponse(context.Context) (ClientRestartResponse, error)` +- New function `NetworkACLs.MarshalJSON() ([]byte, error)` +- New function `*Client.CheckNameAvailability(context.Context, string, NameAvailabilityParameters, *ClientCheckNameAvailabilityOptions) (ClientCheckNameAvailabilityResponse, error)` +- New function `ClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (ClientDeleteResponse, error)` +- New function `*ClientListBySubscriptionPager.Err() error` +- New function `*Client.ListByResourceGroup(string, *ClientListByResourceGroupOptions) *ClientListByResourceGroupPager` +- New function `*SharedPrivateLinkResourcesClientCreateOrUpdatePoller.ResumeToken() (string, error)` +- New function `*Client.Get(context.Context, string, string, *ClientGetOptions) (ClientGetResponse, error)` +- New function `ClientRegenerateKeyPollerResponse.PollUntilDone(context.Context, time.Duration) (ClientRegenerateKeyResponse, error)` +- New function `*ClientCreateOrUpdatePoller.Done() bool` +- New function `*OperationsClientListPager.Err() error` +- New function `*PrivateEndpointConnectionsClientDeletePoller.FinalResponse(context.Context) (PrivateEndpointConnectionsClientDeleteResponse, error)` +- New function `*ClientListBySubscriptionPager.PageResponse() ClientListBySubscriptionResponse` +- New function `*PrivateLinkResourcesClientListPager.NextPage(context.Context) bool` +- New function `*ClientListBySubscriptionPager.NextPage(context.Context) bool` +- New function `*ClientUpdatePoller.ResumeToken() (string, error)` +- New function `ClientRestartPollerResponse.PollUntilDone(context.Context, time.Duration) (ClientRestartResponse, error)` +- New function `NewPrivateEndpointConnectionsClient(string, azcore.TokenCredential, *arm.ClientOptions) *PrivateEndpointConnectionsClient` +- New function `*SharedPrivateLinkResourcesClientDeletePoller.FinalResponse(context.Context) (SharedPrivateLinkResourcesClientDeleteResponse, error)` +- New function `*ClientRestartPoller.ResumeToken() (string, error)` +- New function `*SharedPrivateLinkResourcesClientListPager.Err() error` +- New function `*PrivateEndpointConnectionsClientDeletePoller.ResumeToken() (string, error)` +- New function `*ClientRestartPollerResponse.Resume(context.Context, *Client, string) error` +- New function `ClientUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (ClientUpdateResponse, error)` +- New function `*PrivateEndpointConnectionsClientListPager.Err() error` +- New function `*Client.ListSKUs(context.Context, string, string, *ClientListSKUsOptions) (ClientListSKUsResponse, error)` +- New function `*ClientCreateOrUpdatePollerResponse.Resume(context.Context, *Client, string) error` +- New function `*SharedPrivateLinkResourcesClientDeletePollerResponse.Resume(context.Context, *SharedPrivateLinkResourcesClient, string) error` +- New function `*PrivateEndpointConnectionsClientListPager.NextPage(context.Context) bool` +- New function `*ClientRestartPoller.Done() bool` +- New function `*PrivateLinkResourcesClientListPager.Err() error` +- New function `*ClientCreateOrUpdatePoller.Poll(context.Context) (*http.Response, error)` +- New function `*SharedPrivateLinkResourcesClient.List(string, string, *SharedPrivateLinkResourcesClientListOptions) *SharedPrivateLinkResourcesClientListPager` +- New function `*SharedPrivateLinkResourcesClient.BeginCreateOrUpdate(context.Context, string, string, string, SharedPrivateLinkResource, *SharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions) (SharedPrivateLinkResourcesClientCreateOrUpdatePollerResponse, error)` +- New function `*SharedPrivateLinkResourcesClientDeletePoller.Poll(context.Context) (*http.Response, error)` +- New function `Properties.MarshalJSON() ([]byte, error)` +- New function `*PrivateEndpointConnectionsClientListPager.PageResponse() PrivateEndpointConnectionsClientListResponse` +- New function `*SharedPrivateLinkResourcesClient.BeginDelete(context.Context, string, string, string, *SharedPrivateLinkResourcesClientBeginDeleteOptions) (SharedPrivateLinkResourcesClientDeletePollerResponse, error)` +- New function `*ClientCreateOrUpdatePoller.FinalResponse(context.Context) (ClientCreateOrUpdateResponse, error)` +- New function `*SharedPrivateLinkResourcesClient.Get(context.Context, string, string, string, *SharedPrivateLinkResourcesClientGetOptions) (SharedPrivateLinkResourcesClientGetResponse, error)` +- New function `*UsagesClientListPager.NextPage(context.Context) bool` +- New function `*SharedPrivateLinkResourcesClientListPager.PageResponse() SharedPrivateLinkResourcesClientListResponse` +- New function `NewSharedPrivateLinkResourcesClient(string, azcore.TokenCredential, *arm.ClientOptions) *SharedPrivateLinkResourcesClient` +- New function `*UsagesClientListPager.PageResponse() UsagesClientListResponse` +- New function `*ClientListByResourceGroupPager.Err() error` +- New function `*SharedPrivateLinkResourcesClientDeletePoller.Done() bool` +- New function `PrivateEndpointConnectionsClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (PrivateEndpointConnectionsClientDeleteResponse, error)` +- New function `*SharedPrivateLinkResourcesClientCreateOrUpdatePoller.FinalResponse(context.Context) (SharedPrivateLinkResourcesClientCreateOrUpdateResponse, error)` +- New function `*ClientDeletePoller.Poll(context.Context) (*http.Response, error)` +- New function `*PrivateEndpointConnectionsClient.List(string, string, *PrivateEndpointConnectionsClientListOptions) *PrivateEndpointConnectionsClientListPager` +- New function `*Client.BeginRegenerateKey(context.Context, string, string, RegenerateKeyParameters, *ClientBeginRegenerateKeyOptions) (ClientRegenerateKeyPollerResponse, error)` +- New function `*ClientListByResourceGroupPager.PageResponse() ClientListByResourceGroupResponse` +- New function `ResourceInfoList.MarshalJSON() ([]byte, error)` +- New function `*Client.ListBySubscription(*ClientListBySubscriptionOptions) *ClientListBySubscriptionPager` +- New function `*SharedPrivateLinkResourcesClientCreateOrUpdatePollerResponse.Resume(context.Context, *SharedPrivateLinkResourcesClient, string) error` +- New function `*Client.BeginRestart(context.Context, string, string, *ClientBeginRestartOptions) (ClientRestartPollerResponse, error)` +- New function `*Client.BeginDelete(context.Context, string, string, *ClientBeginDeleteOptions) (ClientDeletePollerResponse, error)` +- New function `*Client.ListKeys(context.Context, string, string, *ClientListKeysOptions) (ClientListKeysResponse, error)` +- New function `*ClientRegenerateKeyPoller.Poll(context.Context) (*http.Response, error)` +- New function `*PrivateEndpointConnectionsClient.Update(context.Context, string, string, string, PrivateEndpointConnection, *PrivateEndpointConnectionsClientUpdateOptions) (PrivateEndpointConnectionsClientUpdateResponse, error)` +- New function `CorsSettings.MarshalJSON() ([]byte, error)` +- New function `*Client.BeginUpdate(context.Context, string, string, ResourceInfo, *ClientBeginUpdateOptions) (ClientUpdatePollerResponse, error)` +- New function `*OperationsClientListPager.PageResponse() OperationsClientListResponse` +- New function `*ClientCreateOrUpdatePoller.ResumeToken() (string, error)` +- New function `*PrivateEndpointConnectionsClient.Get(context.Context, string, string, string, *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error)` +- New function `SharedPrivateLinkResourcesClientCreateOrUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (SharedPrivateLinkResourcesClientCreateOrUpdateResponse, error)` +- New function `*PrivateEndpointConnectionsClientDeletePoller.Done() bool` +- New function `*ClientRegenerateKeyPollerResponse.Resume(context.Context, *Client, string) error` +- New function `*ClientDeletePollerResponse.Resume(context.Context, *Client, string) error` +- New function `*PrivateLinkResourcesClientListPager.PageResponse() PrivateLinkResourcesClientListResponse` +- New function `*ClientRegenerateKeyPoller.FinalResponse(context.Context) (ClientRegenerateKeyResponse, error)` +- New function `*PrivateEndpointConnectionsClient.BeginDelete(context.Context, string, string, string, *PrivateEndpointConnectionsClientBeginDeleteOptions) (PrivateEndpointConnectionsClientDeletePollerResponse, error)` +- New function `*UsagesClientListPager.Err() error` +- New function `*ClientDeletePoller.FinalResponse(context.Context) (ClientDeleteResponse, error)` +- New function `*PrivateEndpointConnectionsClientDeletePoller.Poll(context.Context) (*http.Response, error)` +- New function `*Client.BeginCreateOrUpdate(context.Context, string, string, ResourceInfo, *ClientBeginCreateOrUpdateOptions) (ClientCreateOrUpdatePollerResponse, error)` +- New function `*ClientDeletePoller.ResumeToken() (string, error)` +- New function `*ClientRegenerateKeyPoller.Done() bool` +- New function `*SharedPrivateLinkResourcesClientCreateOrUpdatePoller.Poll(context.Context) (*http.Response, error)` +- New function `NewClient(string, azcore.TokenCredential, *arm.ClientOptions) *Client` +- New function `*SharedPrivateLinkResourcesClientListPager.NextPage(context.Context) bool` +- New function `*OperationsClientListPager.NextPage(context.Context) bool` +- New function `*ClientUpdatePoller.Done() bool` +- New function `*PrivateEndpointConnectionsClientDeletePollerResponse.Resume(context.Context, *PrivateEndpointConnectionsClient, string) error` +- New function `UsageList.MarshalJSON() ([]byte, error)` +- New function `*ClientListByResourceGroupPager.NextPage(context.Context) bool` +- New function `*ClientDeletePoller.Done() bool` +- New struct `Client` +- New struct `ClientBeginCreateOrUpdateOptions` +- New struct `ClientBeginDeleteOptions` +- New struct `ClientBeginRegenerateKeyOptions` +- New struct `ClientBeginRestartOptions` +- New struct `ClientBeginUpdateOptions` +- New struct `ClientCheckNameAvailabilityOptions` +- New struct `ClientCheckNameAvailabilityResponse` +- New struct `ClientCheckNameAvailabilityResult` +- New struct `ClientCreateOrUpdatePoller` +- New struct `ClientCreateOrUpdatePollerResponse` +- New struct `ClientCreateOrUpdateResponse` +- New struct `ClientCreateOrUpdateResult` +- New struct `ClientDeletePoller` +- New struct `ClientDeletePollerResponse` +- New struct `ClientDeleteResponse` +- New struct `ClientGetOptions` +- New struct `ClientGetResponse` +- New struct `ClientGetResult` +- New struct `ClientListByResourceGroupOptions` +- New struct `ClientListByResourceGroupPager` +- New struct `ClientListByResourceGroupResponse` +- New struct `ClientListByResourceGroupResult` +- New struct `ClientListBySubscriptionOptions` +- New struct `ClientListBySubscriptionPager` +- New struct `ClientListBySubscriptionResponse` +- New struct `ClientListBySubscriptionResult` +- New struct `ClientListKeysOptions` +- New struct `ClientListKeysResponse` +- New struct `ClientListKeysResult` +- New struct `ClientListSKUsOptions` +- New struct `ClientListSKUsResponse` +- New struct `ClientListSKUsResult` +- New struct `ClientRegenerateKeyPoller` +- New struct `ClientRegenerateKeyPollerResponse` +- New struct `ClientRegenerateKeyResponse` +- New struct `ClientRegenerateKeyResult` +- New struct `ClientRestartPoller` +- New struct `ClientRestartPollerResponse` +- New struct `ClientRestartResponse` +- New struct `ClientUpdatePoller` +- New struct `ClientUpdatePollerResponse` +- New struct `ClientUpdateResponse` +- New struct `ClientUpdateResult` +- New struct `CorsSettings` +- New struct `Feature` +- New struct `Keys` +- New struct `NetworkACLs` +- New struct `OperationsClientListOptions` +- New struct `OperationsClientListPager` +- New struct `OperationsClientListResponse` +- New struct `OperationsClientListResult` +- New struct `PrivateEndpointConnectionsClient` +- New struct `PrivateEndpointConnectionsClientBeginDeleteOptions` +- New struct `PrivateEndpointConnectionsClientDeletePoller` +- New struct `PrivateEndpointConnectionsClientDeletePollerResponse` +- New struct `PrivateEndpointConnectionsClientDeleteResponse` +- New struct `PrivateEndpointConnectionsClientGetOptions` +- New struct `PrivateEndpointConnectionsClientGetResponse` +- New struct `PrivateEndpointConnectionsClientGetResult` +- New struct `PrivateEndpointConnectionsClientListOptions` +- New struct `PrivateEndpointConnectionsClientListPager` +- New struct `PrivateEndpointConnectionsClientListResponse` +- New struct `PrivateEndpointConnectionsClientListResult` +- New struct `PrivateEndpointConnectionsClientUpdateOptions` +- New struct `PrivateEndpointConnectionsClientUpdateResponse` +- New struct `PrivateEndpointConnectionsClientUpdateResult` +- New struct `PrivateLinkResourcesClient` +- New struct `PrivateLinkResourcesClientListOptions` +- New struct `PrivateLinkResourcesClientListPager` +- New struct `PrivateLinkResourcesClientListResponse` +- New struct `PrivateLinkResourcesClientListResult` +- New struct `Properties` +- New struct `ResourceInfo` +- New struct `ResourceInfoList` +- New struct `SharedPrivateLinkResourcesClient` +- New struct `SharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions` +- New struct `SharedPrivateLinkResourcesClientBeginDeleteOptions` +- New struct `SharedPrivateLinkResourcesClientCreateOrUpdatePoller` +- New struct `SharedPrivateLinkResourcesClientCreateOrUpdatePollerResponse` +- New struct `SharedPrivateLinkResourcesClientCreateOrUpdateResponse` +- New struct `SharedPrivateLinkResourcesClientCreateOrUpdateResult` +- New struct `SharedPrivateLinkResourcesClientDeletePoller` +- New struct `SharedPrivateLinkResourcesClientDeletePollerResponse` +- New struct `SharedPrivateLinkResourcesClientDeleteResponse` +- New struct `SharedPrivateLinkResourcesClientGetOptions` +- New struct `SharedPrivateLinkResourcesClientGetResponse` +- New struct `SharedPrivateLinkResourcesClientGetResult` +- New struct `SharedPrivateLinkResourcesClientListOptions` +- New struct `SharedPrivateLinkResourcesClientListPager` +- New struct `SharedPrivateLinkResourcesClientListResponse` +- New struct `SharedPrivateLinkResourcesClientListResult` +- New struct `TLSSettings` +- New struct `Usage` +- New struct `UsageList` +- New struct `UsageName` +- New struct `UsagesClientListOptions` +- New struct `UsagesClientListPager` +- New struct `UsagesClientListResponse` +- New struct `UsagesClientListResult` +- New field `ID` in struct `TrackedResource` +- New field `Name` in struct `TrackedResource` +- New field `Type` in struct `TrackedResource` +- New field `Name` in struct `PrivateLinkResource` +- New field `Type` in struct `PrivateLinkResource` +- New field `ID` in struct `PrivateLinkResource` +- New field `ID` in struct `PrivateEndpointConnection` +- New field `Name` in struct `PrivateEndpointConnection` +- New field `Type` in struct `PrivateEndpointConnection` +- New field `Allow` in struct `PrivateEndpointACL` +- New field `Deny` in struct `PrivateEndpointACL` +- New field `ID` in struct `ProxyResource` +- New field `Name` in struct `ProxyResource` +- New field `Type` in struct `ProxyResource` +- New field `ID` in struct `SharedPrivateLinkResource` +- New field `Name` in struct `SharedPrivateLinkResource` +- New field `Type` in struct `SharedPrivateLinkResource` + + ## 0.1.0 (2021-12-16) - Init release. diff --git a/sdk/resourcemanager/signalr/armsignalr/autorest.md b/sdk/resourcemanager/signalr/armsignalr/autorest.md index fc90883a29ea..89940ef9e286 100644 --- a/sdk/resourcemanager/signalr/armsignalr/autorest.md +++ b/sdk/resourcemanager/signalr/armsignalr/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/b8cae07c799a07f2e779a9e301f639e9b85124b1/specification/signalr/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/b8cae07c799a07f2e779a9e301f639e9b85124b1/specification/signalr/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/cf47fa91b882618a1043e3aeb5803b3a7397cd08/specification/signalr/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/cf47fa91b882618a1043e3aeb5803b3a7397cd08/specification/signalr/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.1.0 +module-version: 0.2.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/signalr/armsignalr/go.mod b/sdk/resourcemanager/signalr/armsignalr/go.mod index a987d59eced2..e4c679b04d9a 100644 --- a/sdk/resourcemanager/signalr/armsignalr/go.mod +++ b/sdk/resourcemanager/signalr/armsignalr/go.mod @@ -3,7 +3,7 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/signalr/armsignalr go 1.16 require ( - github.com/Azure/azure-sdk-for-go v60.1.0+incompatible - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.12.0 + github.com/Azure/azure-sdk-for-go v61.3.0+incompatible + github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 ) diff --git a/sdk/resourcemanager/signalr/armsignalr/go.sum b/sdk/resourcemanager/signalr/armsignalr/go.sum index 35739a609db5..666ec1c36f73 100644 --- a/sdk/resourcemanager/signalr/armsignalr/go.sum +++ b/sdk/resourcemanager/signalr/armsignalr/go.sum @@ -1,18 +1,28 @@ -github.com/Azure/azure-sdk-for-go v60.1.0+incompatible h1:j6y8ddurcaiyLfwBwPmJFaunp6BDzyQTuAgMrm1r++o= -github.com/Azure/azure-sdk-for-go v60.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0 h1:KQgdWmEOmaJKxaUUZwHAYh12t+b+ZJf8q3friycK1kA= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0/go.mod h1:ZPW/Z0kLCTdDZaDbYTetxc9Cxl/2lNqxYHYNOF2bti0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.12.0 h1:VBvHGLJbaY0+c66NZHdS9cgjHVYSH6DDa0XJMyrblsI= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.12.0/go.mod h1:GJzjM4SR9T0KyX5gKCVyz1ytD8FeWeUPCwtFCt1AyfE= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.1 h1:BUYIbDf/mMZ8945v3QkG3OuqGVyS4Iek0AOLwdRAYoc= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/Azure/azure-sdk-for-go v61.3.0+incompatible h1:k7MKrYcGwX5qh+fC9xVhcEuaZajFfbDYMEgo8oemTLo= +github.com/Azure/azure-sdk-for-go v61.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 h1:8wVJL0HUP5yDFXvotdewORTw7Yu88JbreWN/mobSvsQ= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 h1:bLRntPH25SkY1uZ/YZW+dmxNky9r1fAHvDFrzluo+4Q= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0/go.mod h1:TmXReXZ9yPp5D5TBRMTAtyz+UyOl15Py4hL5E5p6igQ= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 h1:E+m3SkZCN0Bf5q7YdTs5lSm2CYY3CK4spn5OmUIiQtk= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= +github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= +github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= +github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4 h1:49lOXmGaUpV9Fz3gd7TFZY106KVlPVa5jcYD1gaQf98= -github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= +github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= +github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= +github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -24,21 +34,27 @@ golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNm golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b h1:k+E048sYJHyVnsr1GDrRZWQ32D2C7lWs9JRc0bel53A= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= diff --git a/sdk/resourcemanager/signalr/armsignalr/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/signalr/armsignalr/ze_generated_example_operations_client_test.go index 9722864e2fc5..99fba9b1a155 100644 --- a/sdk/resourcemanager/signalr/armsignalr/ze_generated_example_operations_client_test.go +++ b/sdk/resourcemanager/signalr/armsignalr/ze_generated_example_operations_client_test.go @@ -25,9 +25,16 @@ func ExampleOperationsClient_List() { ctx := context.Background() client := armsignalr.NewOperationsClient(cred, nil) pager := client.List(nil) - for pager.NextPage(ctx) { + for { + nextResult := pager.NextPage(ctx) if err := pager.Err(); err != nil { log.Fatalf("failed to advance page: %v", err) } + if !nextResult { + break + } + for _, v := range pager.PageResponse().Value { + log.Printf("Pager result: %#v\n", v) + } } } diff --git a/sdk/resourcemanager/signalr/armsignalr/ze_generated_example_signalr_client_test.go b/sdk/resourcemanager/signalr/armsignalr/ze_generated_example_signalr_client_test.go index ec796a858261..4aacb88550f9 100644 --- a/sdk/resourcemanager/signalr/armsignalr/ze_generated_example_signalr_client_test.go +++ b/sdk/resourcemanager/signalr/armsignalr/ze_generated_example_signalr_client_test.go @@ -20,14 +20,14 @@ import ( ) // x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_CheckNameAvailability.json -func ExampleSignalRClient_CheckNameAvailability() { +func ExampleClient_CheckNameAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client := armsignalr.NewSignalRClient("", cred, nil) - _, err = client.CheckNameAvailability(ctx, + client := armsignalr.NewClient("", cred, nil) + res, err := client.CheckNameAvailability(ctx, "", armsignalr.NameAvailabilityParameters{ Name: to.StringPtr(""), @@ -37,55 +37,64 @@ func ExampleSignalRClient_CheckNameAvailability() { if err != nil { log.Fatal(err) } + log.Printf("Response result: %#v\n", res.ClientCheckNameAvailabilityResult) } // x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_ListBySubscription.json -func ExampleSignalRClient_ListBySubscription() { +func ExampleClient_ListBySubscription() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client := armsignalr.NewSignalRClient("", cred, nil) + client := armsignalr.NewClient("", cred, nil) pager := client.ListBySubscription(nil) - for pager.NextPage(ctx) { + for { + nextResult := pager.NextPage(ctx) if err := pager.Err(); err != nil { log.Fatalf("failed to advance page: %v", err) } + if !nextResult { + break + } for _, v := range pager.PageResponse().Value { - log.Printf("SignalRResource.ID: %s\n", *v.ID) + log.Printf("Pager result: %#v\n", v) } } } // x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_ListByResourceGroup.json -func ExampleSignalRClient_ListByResourceGroup() { +func ExampleClient_ListByResourceGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client := armsignalr.NewSignalRClient("", cred, nil) + client := armsignalr.NewClient("", cred, nil) pager := client.ListByResourceGroup("", nil) - for pager.NextPage(ctx) { + for { + nextResult := pager.NextPage(ctx) if err := pager.Err(); err != nil { log.Fatalf("failed to advance page: %v", err) } + if !nextResult { + break + } for _, v := range pager.PageResponse().Value { - log.Printf("SignalRResource.ID: %s\n", *v.ID) + log.Printf("Pager result: %#v\n", v) } } } // x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_Get.json -func ExampleSignalRClient_Get() { +func ExampleClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client := armsignalr.NewSignalRClient("", cred, nil) + client := armsignalr.NewClient("", cred, nil) res, err := client.Get(ctx, "", "", @@ -93,84 +102,80 @@ func ExampleSignalRClient_Get() { if err != nil { log.Fatal(err) } - log.Printf("SignalRResource.ID: %s\n", *res.ID) + log.Printf("Response result: %#v\n", res.ClientGetResult) } // x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_CreateOrUpdate.json -func ExampleSignalRClient_BeginCreateOrUpdate() { +func ExampleClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client := armsignalr.NewSignalRClient("", cred, nil) + client := armsignalr.NewClient("", cred, nil) poller, err := client.BeginCreateOrUpdate(ctx, "", "", - armsignalr.SignalRResource{ - TrackedResource: armsignalr.TrackedResource{ - Location: to.StringPtr(""), - Tags: map[string]*string{ - "key1": to.StringPtr("value1"), - }, + armsignalr.ResourceInfo{ + Location: to.StringPtr(""), + Tags: map[string]*string{ + "key1": to.StringPtr("value1"), }, Identity: &armsignalr.ManagedIdentity{ - Type: armsignalr.ManagedIdentityTypeSystemAssigned.ToPtr(), + Type: armsignalr.ManagedIdentityType("SystemAssigned").ToPtr(), }, - Kind: armsignalr.ServiceKindSignalR.ToPtr(), - Properties: &armsignalr.SignalRProperties{ - Cors: &armsignalr.SignalRCorsSettings{ + Kind: armsignalr.ServiceKind("SignalR").ToPtr(), + Properties: &armsignalr.Properties{ + Cors: &armsignalr.CorsSettings{ AllowedOrigins: []*string{ to.StringPtr("https://foo.com"), to.StringPtr("https://bar.com")}, }, DisableAADAuth: to.BoolPtr(false), DisableLocalAuth: to.BoolPtr(false), - Features: []*armsignalr.SignalRFeature{ + Features: []*armsignalr.Feature{ { - Flag: armsignalr.FeatureFlagsServiceMode.ToPtr(), + Flag: armsignalr.FeatureFlags("ServiceMode").ToPtr(), Properties: map[string]*string{}, Value: to.StringPtr(""), }, { - Flag: armsignalr.FeatureFlagsEnableConnectivityLogs.ToPtr(), + Flag: armsignalr.FeatureFlags("EnableConnectivityLogs").ToPtr(), Properties: map[string]*string{}, Value: to.StringPtr(""), }, { - Flag: armsignalr.FeatureFlagsEnableMessagingLogs.ToPtr(), + Flag: armsignalr.FeatureFlags("EnableMessagingLogs").ToPtr(), Properties: map[string]*string{}, Value: to.StringPtr(""), }, { - Flag: armsignalr.FeatureFlagsEnableLiveTrace.ToPtr(), + Flag: armsignalr.FeatureFlags("EnableLiveTrace").ToPtr(), Properties: map[string]*string{}, Value: to.StringPtr(""), }}, - NetworkACLs: &armsignalr.SignalRNetworkACLs{ - DefaultAction: armsignalr.ACLActionDeny.ToPtr(), + NetworkACLs: &armsignalr.NetworkACLs{ + DefaultAction: armsignalr.ACLAction("Deny").ToPtr(), PrivateEndpoints: []*armsignalr.PrivateEndpointACL{ { - NetworkACL: armsignalr.NetworkACL{ - Allow: []*armsignalr.SignalRRequestType{ - armsignalr.SignalRRequestTypeServerConnection.ToPtr()}, - }, + Allow: []*armsignalr.SignalRRequestType{ + armsignalr.SignalRRequestType("ServerConnection").ToPtr()}, Name: to.StringPtr(""), }}, PublicNetwork: &armsignalr.NetworkACL{ Allow: []*armsignalr.SignalRRequestType{ - armsignalr.SignalRRequestTypeClientConnection.ToPtr()}, + armsignalr.SignalRRequestType("ClientConnection").ToPtr()}, }, }, PublicNetworkAccess: to.StringPtr(""), - TLS: &armsignalr.SignalRTLSSettings{ + TLS: &armsignalr.TLSSettings{ ClientCertEnabled: to.BoolPtr(false), }, Upstream: &armsignalr.ServerlessUpstreamSettings{ Templates: []*armsignalr.UpstreamTemplate{ { Auth: &armsignalr.UpstreamAuthSettings{ - Type: armsignalr.UpstreamAuthTypeManagedIdentity.ToPtr(), + Type: armsignalr.UpstreamAuthType("ManagedIdentity").ToPtr(), ManagedIdentity: &armsignalr.ManagedIdentitySettings{ Resource: to.StringPtr(""), }, @@ -185,7 +190,7 @@ func ExampleSignalRClient_BeginCreateOrUpdate() { SKU: &armsignalr.ResourceSKU{ Name: to.StringPtr(""), Capacity: to.Int32Ptr(1), - Tier: armsignalr.SignalRSKUTierStandard.ToPtr(), + Tier: armsignalr.SignalRSKUTier("Standard").ToPtr(), }, }, nil) @@ -196,17 +201,17 @@ func ExampleSignalRClient_BeginCreateOrUpdate() { if err != nil { log.Fatal(err) } - log.Printf("SignalRResource.ID: %s\n", *res.ID) + log.Printf("Response result: %#v\n", res.ClientCreateOrUpdateResult) } // x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_Delete.json -func ExampleSignalRClient_BeginDelete() { +func ExampleClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client := armsignalr.NewSignalRClient("", cred, nil) + client := armsignalr.NewClient("", cred, nil) poller, err := client.BeginDelete(ctx, "", "", @@ -221,80 +226,76 @@ func ExampleSignalRClient_BeginDelete() { } // x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_Update.json -func ExampleSignalRClient_BeginUpdate() { +func ExampleClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client := armsignalr.NewSignalRClient("", cred, nil) + client := armsignalr.NewClient("", cred, nil) poller, err := client.BeginUpdate(ctx, "", "", - armsignalr.SignalRResource{ - TrackedResource: armsignalr.TrackedResource{ - Location: to.StringPtr(""), - Tags: map[string]*string{ - "key1": to.StringPtr("value1"), - }, + armsignalr.ResourceInfo{ + Location: to.StringPtr(""), + Tags: map[string]*string{ + "key1": to.StringPtr("value1"), }, Identity: &armsignalr.ManagedIdentity{ - Type: armsignalr.ManagedIdentityTypeSystemAssigned.ToPtr(), + Type: armsignalr.ManagedIdentityType("SystemAssigned").ToPtr(), }, - Kind: armsignalr.ServiceKindSignalR.ToPtr(), - Properties: &armsignalr.SignalRProperties{ - Cors: &armsignalr.SignalRCorsSettings{ + Kind: armsignalr.ServiceKind("SignalR").ToPtr(), + Properties: &armsignalr.Properties{ + Cors: &armsignalr.CorsSettings{ AllowedOrigins: []*string{ to.StringPtr("https://foo.com"), to.StringPtr("https://bar.com")}, }, DisableAADAuth: to.BoolPtr(false), DisableLocalAuth: to.BoolPtr(false), - Features: []*armsignalr.SignalRFeature{ + Features: []*armsignalr.Feature{ { - Flag: armsignalr.FeatureFlagsServiceMode.ToPtr(), + Flag: armsignalr.FeatureFlags("ServiceMode").ToPtr(), Properties: map[string]*string{}, Value: to.StringPtr(""), }, { - Flag: armsignalr.FeatureFlagsEnableConnectivityLogs.ToPtr(), + Flag: armsignalr.FeatureFlags("EnableConnectivityLogs").ToPtr(), Properties: map[string]*string{}, Value: to.StringPtr(""), }, { - Flag: armsignalr.FeatureFlagsEnableMessagingLogs.ToPtr(), + Flag: armsignalr.FeatureFlags("EnableMessagingLogs").ToPtr(), Properties: map[string]*string{}, Value: to.StringPtr(""), }, { - Flag: armsignalr.FeatureFlagsEnableLiveTrace.ToPtr(), + Flag: armsignalr.FeatureFlags("EnableLiveTrace").ToPtr(), Properties: map[string]*string{}, Value: to.StringPtr(""), }}, - NetworkACLs: &armsignalr.SignalRNetworkACLs{ - DefaultAction: armsignalr.ACLActionDeny.ToPtr(), + NetworkACLs: &armsignalr.NetworkACLs{ + DefaultAction: armsignalr.ACLAction("Deny").ToPtr(), PrivateEndpoints: []*armsignalr.PrivateEndpointACL{ { - NetworkACL: armsignalr.NetworkACL{ - Allow: []*armsignalr.SignalRRequestType{ - armsignalr.SignalRRequestTypeServerConnection.ToPtr()}, - }, + Allow: []*armsignalr.SignalRRequestType{ + armsignalr.SignalRRequestType("ServerConnection").ToPtr()}, Name: to.StringPtr(""), }}, PublicNetwork: &armsignalr.NetworkACL{ Allow: []*armsignalr.SignalRRequestType{ - armsignalr.SignalRRequestTypeClientConnection.ToPtr()}, + armsignalr.SignalRRequestType("ClientConnection").ToPtr()}, }, }, PublicNetworkAccess: to.StringPtr(""), - TLS: &armsignalr.SignalRTLSSettings{ + TLS: &armsignalr.TLSSettings{ ClientCertEnabled: to.BoolPtr(false), }, Upstream: &armsignalr.ServerlessUpstreamSettings{ Templates: []*armsignalr.UpstreamTemplate{ { Auth: &armsignalr.UpstreamAuthSettings{ - Type: armsignalr.UpstreamAuthTypeManagedIdentity.ToPtr(), + Type: armsignalr.UpstreamAuthType("ManagedIdentity").ToPtr(), ManagedIdentity: &armsignalr.ManagedIdentitySettings{ Resource: to.StringPtr(""), }, @@ -309,7 +310,7 @@ func ExampleSignalRClient_BeginUpdate() { SKU: &armsignalr.ResourceSKU{ Name: to.StringPtr(""), Capacity: to.Int32Ptr(1), - Tier: armsignalr.SignalRSKUTierStandard.ToPtr(), + Tier: armsignalr.SignalRSKUTier("Standard").ToPtr(), }, }, nil) @@ -320,39 +321,40 @@ func ExampleSignalRClient_BeginUpdate() { if err != nil { log.Fatal(err) } - log.Printf("SignalRResource.ID: %s\n", *res.ID) + log.Printf("Response result: %#v\n", res.ClientUpdateResult) } // x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_ListKeys.json -func ExampleSignalRClient_ListKeys() { +func ExampleClient_ListKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client := armsignalr.NewSignalRClient("", cred, nil) - _, err = client.ListKeys(ctx, + client := armsignalr.NewClient("", cred, nil) + res, err := client.ListKeys(ctx, "", "", nil) if err != nil { log.Fatal(err) } + log.Printf("Response result: %#v\n", res.ClientListKeysResult) } // x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_RegenerateKey.json -func ExampleSignalRClient_BeginRegenerateKey() { +func ExampleClient_BeginRegenerateKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client := armsignalr.NewSignalRClient("", cred, nil) + client := armsignalr.NewClient("", cred, nil) poller, err := client.BeginRegenerateKey(ctx, "", "", armsignalr.RegenerateKeyParameters{ - KeyType: armsignalr.KeyTypePrimary.ToPtr(), + KeyType: armsignalr.KeyType("Primary").ToPtr(), }, nil) if err != nil { @@ -365,13 +367,13 @@ func ExampleSignalRClient_BeginRegenerateKey() { } // x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_Restart.json -func ExampleSignalRClient_BeginRestart() { +func ExampleClient_BeginRestart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client := armsignalr.NewSignalRClient("", cred, nil) + client := armsignalr.NewClient("", cred, nil) poller, err := client.BeginRestart(ctx, "", "", @@ -384,20 +386,3 @@ func ExampleSignalRClient_BeginRestart() { log.Fatal(err) } } - -// x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalR_ListSkus.json -func ExampleSignalRClient_ListSKUs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsignalr.NewSignalRClient("", cred, nil) - _, err = client.ListSKUs(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/signalr/armsignalr/ze_generated_example_signalrprivateendpointconnections_client_test.go b/sdk/resourcemanager/signalr/armsignalr/ze_generated_example_signalrprivateendpointconnections_client_test.go index ff57ccc6eea1..b41d018fff25 100644 --- a/sdk/resourcemanager/signalr/armsignalr/ze_generated_example_signalrprivateendpointconnections_client_test.go +++ b/sdk/resourcemanager/signalr/armsignalr/ze_generated_example_signalrprivateendpointconnections_client_test.go @@ -20,34 +20,38 @@ import ( ) // x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRPrivateEndpointConnections_List.json -func ExampleSignalRPrivateEndpointConnectionsClient_List() { +func ExamplePrivateEndpointConnectionsClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client := armsignalr.NewSignalRPrivateEndpointConnectionsClient("", cred, nil) + client := armsignalr.NewPrivateEndpointConnectionsClient("", cred, nil) pager := client.List("", "", nil) - for pager.NextPage(ctx) { + for { + nextResult := pager.NextPage(ctx) if err := pager.Err(); err != nil { log.Fatalf("failed to advance page: %v", err) } + if !nextResult { + break + } for _, v := range pager.PageResponse().Value { - log.Printf("PrivateEndpointConnection.ID: %s\n", *v.ID) + log.Printf("Pager result: %#v\n", v) } } } // x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRPrivateEndpointConnections_Get.json -func ExampleSignalRPrivateEndpointConnectionsClient_Get() { +func ExamplePrivateEndpointConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client := armsignalr.NewSignalRPrivateEndpointConnectionsClient("", cred, nil) + client := armsignalr.NewPrivateEndpointConnectionsClient("", cred, nil) res, err := client.Get(ctx, "", "", @@ -56,17 +60,17 @@ func ExampleSignalRPrivateEndpointConnectionsClient_Get() { if err != nil { log.Fatal(err) } - log.Printf("PrivateEndpointConnection.ID: %s\n", *res.ID) + log.Printf("Response result: %#v\n", res.PrivateEndpointConnectionsClientGetResult) } // x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRPrivateEndpointConnections_Update.json -func ExampleSignalRPrivateEndpointConnectionsClient_Update() { +func ExamplePrivateEndpointConnectionsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client := armsignalr.NewSignalRPrivateEndpointConnectionsClient("", cred, nil) + client := armsignalr.NewPrivateEndpointConnectionsClient("", cred, nil) res, err := client.Update(ctx, "", "", @@ -78,7 +82,7 @@ func ExampleSignalRPrivateEndpointConnectionsClient_Update() { }, PrivateLinkServiceConnectionState: &armsignalr.PrivateLinkServiceConnectionState{ ActionsRequired: to.StringPtr(""), - Status: armsignalr.PrivateLinkServiceConnectionStatusApproved.ToPtr(), + Status: armsignalr.PrivateLinkServiceConnectionStatus("Approved").ToPtr(), }, }, }, @@ -86,17 +90,17 @@ func ExampleSignalRPrivateEndpointConnectionsClient_Update() { if err != nil { log.Fatal(err) } - log.Printf("PrivateEndpointConnection.ID: %s\n", *res.ID) + log.Printf("Response result: %#v\n", res.PrivateEndpointConnectionsClientUpdateResult) } // x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRPrivateEndpointConnections_Delete.json -func ExampleSignalRPrivateEndpointConnectionsClient_BeginDelete() { +func ExamplePrivateEndpointConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client := armsignalr.NewSignalRPrivateEndpointConnectionsClient("", cred, nil) + client := armsignalr.NewPrivateEndpointConnectionsClient("", cred, nil) poller, err := client.BeginDelete(ctx, "", "", diff --git a/sdk/resourcemanager/signalr/armsignalr/ze_generated_example_signalrprivatelinkresources_client_test.go b/sdk/resourcemanager/signalr/armsignalr/ze_generated_example_signalrprivatelinkresources_client_test.go index 85e55739869b..1cea314d069c 100644 --- a/sdk/resourcemanager/signalr/armsignalr/ze_generated_example_signalrprivatelinkresources_client_test.go +++ b/sdk/resourcemanager/signalr/armsignalr/ze_generated_example_signalrprivatelinkresources_client_test.go @@ -17,22 +17,26 @@ import ( ) // x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRPrivateLinkResources_List.json -func ExampleSignalRPrivateLinkResourcesClient_List() { +func ExamplePrivateLinkResourcesClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client := armsignalr.NewSignalRPrivateLinkResourcesClient("", cred, nil) + client := armsignalr.NewPrivateLinkResourcesClient("", cred, nil) pager := client.List("", "", nil) - for pager.NextPage(ctx) { + for { + nextResult := pager.NextPage(ctx) if err := pager.Err(); err != nil { log.Fatalf("failed to advance page: %v", err) } + if !nextResult { + break + } for _, v := range pager.PageResponse().Value { - log.Printf("PrivateLinkResource.ID: %s\n", *v.ID) + log.Printf("Pager result: %#v\n", v) } } } diff --git a/sdk/resourcemanager/signalr/armsignalr/ze_generated_example_signalrsharedprivatelinkresources_client_test.go b/sdk/resourcemanager/signalr/armsignalr/ze_generated_example_signalrsharedprivatelinkresources_client_test.go index ef1af8b8b43b..1c84fbf7c607 100644 --- a/sdk/resourcemanager/signalr/armsignalr/ze_generated_example_signalrsharedprivatelinkresources_client_test.go +++ b/sdk/resourcemanager/signalr/armsignalr/ze_generated_example_signalrsharedprivatelinkresources_client_test.go @@ -20,34 +20,38 @@ import ( ) // x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRSharedPrivateLinkResources_List.json -func ExampleSignalRSharedPrivateLinkResourcesClient_List() { +func ExampleSharedPrivateLinkResourcesClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client := armsignalr.NewSignalRSharedPrivateLinkResourcesClient("", cred, nil) + client := armsignalr.NewSharedPrivateLinkResourcesClient("", cred, nil) pager := client.List("", "", nil) - for pager.NextPage(ctx) { + for { + nextResult := pager.NextPage(ctx) if err := pager.Err(); err != nil { log.Fatalf("failed to advance page: %v", err) } + if !nextResult { + break + } for _, v := range pager.PageResponse().Value { - log.Printf("SharedPrivateLinkResource.ID: %s\n", *v.ID) + log.Printf("Pager result: %#v\n", v) } } } // x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRSharedPrivateLinkResources_Get.json -func ExampleSignalRSharedPrivateLinkResourcesClient_Get() { +func ExampleSharedPrivateLinkResourcesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client := armsignalr.NewSignalRSharedPrivateLinkResourcesClient("", cred, nil) + client := armsignalr.NewSharedPrivateLinkResourcesClient("", cred, nil) res, err := client.Get(ctx, "", "", @@ -56,17 +60,17 @@ func ExampleSignalRSharedPrivateLinkResourcesClient_Get() { if err != nil { log.Fatal(err) } - log.Printf("SharedPrivateLinkResource.ID: %s\n", *res.ID) + log.Printf("Response result: %#v\n", res.SharedPrivateLinkResourcesClientGetResult) } // x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRSharedPrivateLinkResources_CreateOrUpdate.json -func ExampleSignalRSharedPrivateLinkResourcesClient_BeginCreateOrUpdate() { +func ExampleSharedPrivateLinkResourcesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client := armsignalr.NewSignalRSharedPrivateLinkResourcesClient("", cred, nil) + client := armsignalr.NewSharedPrivateLinkResourcesClient("", cred, nil) poller, err := client.BeginCreateOrUpdate(ctx, "", "", @@ -86,17 +90,17 @@ func ExampleSignalRSharedPrivateLinkResourcesClient_BeginCreateOrUpdate() { if err != nil { log.Fatal(err) } - log.Printf("SharedPrivateLinkResource.ID: %s\n", *res.ID) + log.Printf("Response result: %#v\n", res.SharedPrivateLinkResourcesClientCreateOrUpdateResult) } // x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2021-10-01/examples/SignalRSharedPrivateLinkResources_Delete.json -func ExampleSignalRSharedPrivateLinkResourcesClient_BeginDelete() { +func ExampleSharedPrivateLinkResourcesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client := armsignalr.NewSignalRSharedPrivateLinkResourcesClient("", cred, nil) + client := armsignalr.NewSharedPrivateLinkResourcesClient("", cred, nil) poller, err := client.BeginDelete(ctx, "", "", diff --git a/sdk/resourcemanager/signalr/armsignalr/ze_generated_example_usages_client_test.go b/sdk/resourcemanager/signalr/armsignalr/ze_generated_example_usages_client_test.go index 2fdeab3c783a..e01d6ad8de64 100644 --- a/sdk/resourcemanager/signalr/armsignalr/ze_generated_example_usages_client_test.go +++ b/sdk/resourcemanager/signalr/armsignalr/ze_generated_example_usages_client_test.go @@ -26,12 +26,16 @@ func ExampleUsagesClient_List() { client := armsignalr.NewUsagesClient("", cred, nil) pager := client.List("", nil) - for pager.NextPage(ctx) { + for { + nextResult := pager.NextPage(ctx) if err := pager.Err(); err != nil { log.Fatalf("failed to advance page: %v", err) } + if !nextResult { + break + } for _, v := range pager.PageResponse().Value { - log.Printf("SignalRUsage.ID: %s\n", *v.ID) + log.Printf("Pager result: %#v\n", v) } } } diff --git a/sdk/resourcemanager/signalr/armsignalr/zz_generated_signalr_client.go b/sdk/resourcemanager/signalr/armsignalr/zz_generated_client.go similarity index 50% rename from sdk/resourcemanager/signalr/armsignalr/zz_generated_signalr_client.go rename to sdk/resourcemanager/signalr/armsignalr/zz_generated_client.go index d0d440a2e40f..f209e2a59dcc 100644 --- a/sdk/resourcemanager/signalr/armsignalr/zz_generated_signalr_client.go +++ b/sdk/resourcemanager/signalr/armsignalr/zz_generated_client.go @@ -11,7 +11,6 @@ package armsignalr import ( "context" "errors" - "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" @@ -22,45 +21,57 @@ import ( "strings" ) -// SignalRClient contains the methods for the SignalR group. -// Don't use this type directly, use NewSignalRClient() instead. -type SignalRClient struct { - ep string - pl runtime.Pipeline +// Client contains the methods for the SignalR group. +// Don't use this type directly, use NewClient() instead. +type Client struct { + host string subscriptionID string + pl runtime.Pipeline } -// NewSignalRClient creates a new instance of SignalRClient with the specified values. -func NewSignalRClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *SignalRClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +// NewClient creates a new instance of Client with the specified values. +// subscriptionID - Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *Client { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Host) == 0 { - cp.Host = arm.AzurePublicCloud + ep := options.Endpoint + if len(ep) == 0 { + ep = arm.AzurePublicCloud } - return &SignalRClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} + client := &Client{ + subscriptionID: subscriptionID, + host: string(ep), + pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + } + return client } // CheckNameAvailability - Checks that the resource name is valid and is not already in use. -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRClient) CheckNameAvailability(ctx context.Context, location string, parameters NameAvailabilityParameters, options *SignalRCheckNameAvailabilityOptions) (SignalRCheckNameAvailabilityResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// location - the region +// parameters - Parameters supplied to the operation. +// options - ClientCheckNameAvailabilityOptions contains the optional parameters for the Client.CheckNameAvailability method. +func (client *Client) CheckNameAvailability(ctx context.Context, location string, parameters NameAvailabilityParameters, options *ClientCheckNameAvailabilityOptions) (ClientCheckNameAvailabilityResponse, error) { req, err := client.checkNameAvailabilityCreateRequest(ctx, location, parameters, options) if err != nil { - return SignalRCheckNameAvailabilityResponse{}, err + return ClientCheckNameAvailabilityResponse{}, err } resp, err := client.pl.Do(req) if err != nil { - return SignalRCheckNameAvailabilityResponse{}, err + return ClientCheckNameAvailabilityResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return SignalRCheckNameAvailabilityResponse{}, client.checkNameAvailabilityHandleError(resp) + return ClientCheckNameAvailabilityResponse{}, runtime.NewResponseError(resp) } return client.checkNameAvailabilityHandleResponse(resp) } // checkNameAvailabilityCreateRequest creates the CheckNameAvailability request. -func (client *SignalRClient) checkNameAvailabilityCreateRequest(ctx context.Context, location string, parameters NameAvailabilityParameters, options *SignalRCheckNameAvailabilityOptions) (*policy.Request, error) { +func (client *Client) checkNameAvailabilityCreateRequest(ctx context.Context, location string, parameters NameAvailabilityParameters, options *ClientCheckNameAvailabilityOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/locations/{location}/checkNameAvailability" if location == "" { return nil, errors.New("parameter location cannot be empty") @@ -70,7 +81,7 @@ func (client *SignalRClient) checkNameAvailabilityCreateRequest(ctx context.Cont return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } @@ -82,50 +93,42 @@ func (client *SignalRClient) checkNameAvailabilityCreateRequest(ctx context.Cont } // checkNameAvailabilityHandleResponse handles the CheckNameAvailability response. -func (client *SignalRClient) checkNameAvailabilityHandleResponse(resp *http.Response) (SignalRCheckNameAvailabilityResponse, error) { - result := SignalRCheckNameAvailabilityResponse{RawResponse: resp} +func (client *Client) checkNameAvailabilityHandleResponse(resp *http.Response) (ClientCheckNameAvailabilityResponse, error) { + result := ClientCheckNameAvailabilityResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.NameAvailability); err != nil { - return SignalRCheckNameAvailabilityResponse{}, runtime.NewResponseError(err, resp) + return ClientCheckNameAvailabilityResponse{}, err } return result, nil } -// checkNameAvailabilityHandleError handles the CheckNameAvailability error response. -func (client *SignalRClient) checkNameAvailabilityHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := ErrorResponse{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // BeginCreateOrUpdate - Create or update a resource. -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters SignalRResource, options *SignalRBeginCreateOrUpdateOptions) (SignalRCreateOrUpdatePollerResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// resourceName - The name of the resource. +// parameters - Parameters for the create or update operation +// options - ClientBeginCreateOrUpdateOptions contains the optional parameters for the Client.BeginCreateOrUpdate method. +func (client *Client) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters ResourceInfo, options *ClientBeginCreateOrUpdateOptions) (ClientCreateOrUpdatePollerResponse, error) { resp, err := client.createOrUpdate(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { - return SignalRCreateOrUpdatePollerResponse{}, err + return ClientCreateOrUpdatePollerResponse{}, err } - result := SignalRCreateOrUpdatePollerResponse{ + result := ClientCreateOrUpdatePollerResponse{ RawResponse: resp, } - pt, err := armruntime.NewPoller("SignalRClient.CreateOrUpdate", "", resp, client.pl, client.createOrUpdateHandleError) + pt, err := armruntime.NewPoller("Client.CreateOrUpdate", "", resp, client.pl) if err != nil { - return SignalRCreateOrUpdatePollerResponse{}, err + return ClientCreateOrUpdatePollerResponse{}, err } - result.Poller = &SignalRCreateOrUpdatePoller{ + result.Poller = &ClientCreateOrUpdatePoller{ pt: pt, } return result, nil } // CreateOrUpdate - Create or update a resource. -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters SignalRResource, options *SignalRBeginCreateOrUpdateOptions) (*http.Response, error) { +// If the operation fails it returns an *azcore.ResponseError type. +func (client *Client) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters ResourceInfo, options *ClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { return nil, err @@ -135,13 +138,13 @@ func (client *SignalRClient) createOrUpdate(ctx context.Context, resourceGroupNa return nil, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, client.createOrUpdateHandleError(resp) + return nil, runtime.NewResponseError(resp) } return resp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *SignalRClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters SignalRResource, options *SignalRBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *Client) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters ResourceInfo, options *ClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -155,7 +158,7 @@ func (client *SignalRClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } @@ -166,42 +169,33 @@ func (client *SignalRClient) createOrUpdateCreateRequest(ctx context.Context, re return req, runtime.MarshalAsJSON(req, parameters) } -// createOrUpdateHandleError handles the CreateOrUpdate error response. -func (client *SignalRClient) createOrUpdateHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := ErrorResponse{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // BeginDelete - Operation to delete a resource. -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, options *SignalRBeginDeleteOptions) (SignalRDeletePollerResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// resourceName - The name of the resource. +// options - ClientBeginDeleteOptions contains the optional parameters for the Client.BeginDelete method. +func (client *Client) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, options *ClientBeginDeleteOptions) (ClientDeletePollerResponse, error) { resp, err := client.deleteOperation(ctx, resourceGroupName, resourceName, options) if err != nil { - return SignalRDeletePollerResponse{}, err + return ClientDeletePollerResponse{}, err } - result := SignalRDeletePollerResponse{ + result := ClientDeletePollerResponse{ RawResponse: resp, } - pt, err := armruntime.NewPoller("SignalRClient.Delete", "", resp, client.pl, client.deleteHandleError) + pt, err := armruntime.NewPoller("Client.Delete", "", resp, client.pl) if err != nil { - return SignalRDeletePollerResponse{}, err + return ClientDeletePollerResponse{}, err } - result.Poller = &SignalRDeletePoller{ + result.Poller = &ClientDeletePoller{ pt: pt, } return result, nil } // Delete - Operation to delete a resource. -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, options *SignalRBeginDeleteOptions) (*http.Response, error) { +// If the operation fails it returns an *azcore.ResponseError type. +func (client *Client) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, options *ClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return nil, err @@ -211,13 +205,13 @@ func (client *SignalRClient) deleteOperation(ctx context.Context, resourceGroupN return nil, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, client.deleteHandleError(resp) + return nil, runtime.NewResponseError(resp) } return resp, nil } // deleteCreateRequest creates the Delete request. -func (client *SignalRClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *SignalRBeginDeleteOptions) (*policy.Request, error) { +func (client *Client) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -231,7 +225,7 @@ func (client *SignalRClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } @@ -242,38 +236,29 @@ func (client *SignalRClient) deleteCreateRequest(ctx context.Context, resourceGr return req, nil } -// deleteHandleError handles the Delete error response. -func (client *SignalRClient) deleteHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := ErrorResponse{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Get - Get the resource and its properties. -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRClient) Get(ctx context.Context, resourceGroupName string, resourceName string, options *SignalRGetOptions) (SignalRGetResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// resourceName - The name of the resource. +// options - ClientGetOptions contains the optional parameters for the Client.Get method. +func (client *Client) Get(ctx context.Context, resourceGroupName string, resourceName string, options *ClientGetOptions) (ClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { - return SignalRGetResponse{}, err + return ClientGetResponse{}, err } resp, err := client.pl.Do(req) if err != nil { - return SignalRGetResponse{}, err + return ClientGetResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return SignalRGetResponse{}, client.getHandleError(resp) + return ClientGetResponse{}, runtime.NewResponseError(resp) } return client.getHandleResponse(resp) } // getCreateRequest creates the Get request. -func (client *SignalRClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *SignalRGetOptions) (*policy.Request, error) { +func (client *Client) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -287,7 +272,7 @@ func (client *SignalRClient) getCreateRequest(ctx context.Context, resourceGroup return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } @@ -299,43 +284,33 @@ func (client *SignalRClient) getCreateRequest(ctx context.Context, resourceGroup } // getHandleResponse handles the Get response. -func (client *SignalRClient) getHandleResponse(resp *http.Response) (SignalRGetResponse, error) { - result := SignalRGetResponse{RawResponse: resp} - if err := runtime.UnmarshalAsJSON(resp, &result.SignalRResource); err != nil { - return SignalRGetResponse{}, runtime.NewResponseError(err, resp) +func (client *Client) getHandleResponse(resp *http.Response) (ClientGetResponse, error) { + result := ClientGetResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceInfo); err != nil { + return ClientGetResponse{}, err } return result, nil } -// getHandleError handles the Get error response. -func (client *SignalRClient) getHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := ErrorResponse{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // ListByResourceGroup - Handles requests to list all resources in a resource group. -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRClient) ListByResourceGroup(resourceGroupName string, options *SignalRListByResourceGroupOptions) *SignalRListByResourceGroupPager { - return &SignalRListByResourceGroupPager{ +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// options - ClientListByResourceGroupOptions contains the optional parameters for the Client.ListByResourceGroup method. +func (client *Client) ListByResourceGroup(resourceGroupName string, options *ClientListByResourceGroupOptions) *ClientListByResourceGroupPager { + return &ClientListByResourceGroupPager{ client: client, requester: func(ctx context.Context) (*policy.Request, error) { return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) }, - advancer: func(ctx context.Context, resp SignalRListByResourceGroupResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.SignalRResourceList.NextLink) + advancer: func(ctx context.Context, resp ClientListByResourceGroupResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ResourceInfoList.NextLink) }, } } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *SignalRClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *SignalRListByResourceGroupOptions) (*policy.Request, error) { +func (client *Client) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -345,7 +320,7 @@ func (client *SignalRClient) listByResourceGroupCreateRequest(ctx context.Contex return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } @@ -357,49 +332,37 @@ func (client *SignalRClient) listByResourceGroupCreateRequest(ctx context.Contex } // listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *SignalRClient) listByResourceGroupHandleResponse(resp *http.Response) (SignalRListByResourceGroupResponse, error) { - result := SignalRListByResourceGroupResponse{RawResponse: resp} - if err := runtime.UnmarshalAsJSON(resp, &result.SignalRResourceList); err != nil { - return SignalRListByResourceGroupResponse{}, runtime.NewResponseError(err, resp) +func (client *Client) listByResourceGroupHandleResponse(resp *http.Response) (ClientListByResourceGroupResponse, error) { + result := ClientListByResourceGroupResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceInfoList); err != nil { + return ClientListByResourceGroupResponse{}, err } return result, nil } -// listByResourceGroupHandleError handles the ListByResourceGroup error response. -func (client *SignalRClient) listByResourceGroupHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := ErrorResponse{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // ListBySubscription - Handles requests to list all resources in a subscription. -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRClient) ListBySubscription(options *SignalRListBySubscriptionOptions) *SignalRListBySubscriptionPager { - return &SignalRListBySubscriptionPager{ +// If the operation fails it returns an *azcore.ResponseError type. +// options - ClientListBySubscriptionOptions contains the optional parameters for the Client.ListBySubscription method. +func (client *Client) ListBySubscription(options *ClientListBySubscriptionOptions) *ClientListBySubscriptionPager { + return &ClientListBySubscriptionPager{ client: client, requester: func(ctx context.Context) (*policy.Request, error) { return client.listBySubscriptionCreateRequest(ctx, options) }, - advancer: func(ctx context.Context, resp SignalRListBySubscriptionResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.SignalRResourceList.NextLink) + advancer: func(ctx context.Context, resp ClientListBySubscriptionResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ResourceInfoList.NextLink) }, } } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *SignalRClient) listBySubscriptionCreateRequest(ctx context.Context, options *SignalRListBySubscriptionOptions) (*policy.Request, error) { +func (client *Client) listBySubscriptionCreateRequest(ctx context.Context, options *ClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/signalR" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } @@ -411,46 +374,37 @@ func (client *SignalRClient) listBySubscriptionCreateRequest(ctx context.Context } // listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *SignalRClient) listBySubscriptionHandleResponse(resp *http.Response) (SignalRListBySubscriptionResponse, error) { - result := SignalRListBySubscriptionResponse{RawResponse: resp} - if err := runtime.UnmarshalAsJSON(resp, &result.SignalRResourceList); err != nil { - return SignalRListBySubscriptionResponse{}, runtime.NewResponseError(err, resp) +func (client *Client) listBySubscriptionHandleResponse(resp *http.Response) (ClientListBySubscriptionResponse, error) { + result := ClientListBySubscriptionResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceInfoList); err != nil { + return ClientListBySubscriptionResponse{}, err } return result, nil } -// listBySubscriptionHandleError handles the ListBySubscription error response. -func (client *SignalRClient) listBySubscriptionHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := ErrorResponse{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // ListKeys - Get the access keys of the resource. -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRClient) ListKeys(ctx context.Context, resourceGroupName string, resourceName string, options *SignalRListKeysOptions) (SignalRListKeysResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// resourceName - The name of the resource. +// options - ClientListKeysOptions contains the optional parameters for the Client.ListKeys method. +func (client *Client) ListKeys(ctx context.Context, resourceGroupName string, resourceName string, options *ClientListKeysOptions) (ClientListKeysResponse, error) { req, err := client.listKeysCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { - return SignalRListKeysResponse{}, err + return ClientListKeysResponse{}, err } resp, err := client.pl.Do(req) if err != nil { - return SignalRListKeysResponse{}, err + return ClientListKeysResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return SignalRListKeysResponse{}, client.listKeysHandleError(resp) + return ClientListKeysResponse{}, runtime.NewResponseError(resp) } return client.listKeysHandleResponse(resp) } // listKeysCreateRequest creates the ListKeys request. -func (client *SignalRClient) listKeysCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *SignalRListKeysOptions) (*policy.Request, error) { +func (client *Client) listKeysCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ClientListKeysOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/listKeys" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -464,7 +418,7 @@ func (client *SignalRClient) listKeysCreateRequest(ctx context.Context, resource return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } @@ -476,46 +430,37 @@ func (client *SignalRClient) listKeysCreateRequest(ctx context.Context, resource } // listKeysHandleResponse handles the ListKeys response. -func (client *SignalRClient) listKeysHandleResponse(resp *http.Response) (SignalRListKeysResponse, error) { - result := SignalRListKeysResponse{RawResponse: resp} - if err := runtime.UnmarshalAsJSON(resp, &result.SignalRKeys); err != nil { - return SignalRListKeysResponse{}, runtime.NewResponseError(err, resp) +func (client *Client) listKeysHandleResponse(resp *http.Response) (ClientListKeysResponse, error) { + result := ClientListKeysResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Keys); err != nil { + return ClientListKeysResponse{}, err } return result, nil } -// listKeysHandleError handles the ListKeys error response. -func (client *SignalRClient) listKeysHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := ErrorResponse{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // ListSKUs - List all available skus of the resource. -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRClient) ListSKUs(ctx context.Context, resourceGroupName string, resourceName string, options *SignalRListSKUsOptions) (SignalRListSKUsResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// resourceName - The name of the resource. +// options - ClientListSKUsOptions contains the optional parameters for the Client.ListSKUs method. +func (client *Client) ListSKUs(ctx context.Context, resourceGroupName string, resourceName string, options *ClientListSKUsOptions) (ClientListSKUsResponse, error) { req, err := client.listSKUsCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { - return SignalRListSKUsResponse{}, err + return ClientListSKUsResponse{}, err } resp, err := client.pl.Do(req) if err != nil { - return SignalRListSKUsResponse{}, err + return ClientListSKUsResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return SignalRListSKUsResponse{}, client.listSKUsHandleError(resp) + return ClientListSKUsResponse{}, runtime.NewResponseError(resp) } return client.listSKUsHandleResponse(resp) } // listSKUsCreateRequest creates the ListSKUs request. -func (client *SignalRClient) listSKUsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *SignalRListSKUsOptions) (*policy.Request, error) { +func (client *Client) listSKUsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ClientListSKUsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/skus" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -529,7 +474,7 @@ func (client *SignalRClient) listSKUsCreateRequest(ctx context.Context, resource return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } @@ -541,50 +486,44 @@ func (client *SignalRClient) listSKUsCreateRequest(ctx context.Context, resource } // listSKUsHandleResponse handles the ListSKUs response. -func (client *SignalRClient) listSKUsHandleResponse(resp *http.Response) (SignalRListSKUsResponse, error) { - result := SignalRListSKUsResponse{RawResponse: resp} +func (client *Client) listSKUsHandleResponse(resp *http.Response) (ClientListSKUsResponse, error) { + result := ClientListSKUsResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.SKUList); err != nil { - return SignalRListSKUsResponse{}, runtime.NewResponseError(err, resp) + return ClientListSKUsResponse{}, err } return result, nil } -// listSKUsHandleError handles the ListSKUs error response. -func (client *SignalRClient) listSKUsHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := ErrorResponse{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// BeginRegenerateKey - Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the same time. -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRClient) BeginRegenerateKey(ctx context.Context, resourceGroupName string, resourceName string, parameters RegenerateKeyParameters, options *SignalRBeginRegenerateKeyOptions) (SignalRRegenerateKeyPollerResponse, error) { +// BeginRegenerateKey - Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the +// same time. +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// resourceName - The name of the resource. +// parameters - Parameter that describes the Regenerate Key Operation. +// options - ClientBeginRegenerateKeyOptions contains the optional parameters for the Client.BeginRegenerateKey method. +func (client *Client) BeginRegenerateKey(ctx context.Context, resourceGroupName string, resourceName string, parameters RegenerateKeyParameters, options *ClientBeginRegenerateKeyOptions) (ClientRegenerateKeyPollerResponse, error) { resp, err := client.regenerateKey(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { - return SignalRRegenerateKeyPollerResponse{}, err + return ClientRegenerateKeyPollerResponse{}, err } - result := SignalRRegenerateKeyPollerResponse{ + result := ClientRegenerateKeyPollerResponse{ RawResponse: resp, } - pt, err := armruntime.NewPoller("SignalRClient.RegenerateKey", "azure-async-operation", resp, client.pl, client.regenerateKeyHandleError) + pt, err := armruntime.NewPoller("Client.RegenerateKey", "azure-async-operation", resp, client.pl) if err != nil { - return SignalRRegenerateKeyPollerResponse{}, err + return ClientRegenerateKeyPollerResponse{}, err } - result.Poller = &SignalRRegenerateKeyPoller{ + result.Poller = &ClientRegenerateKeyPoller{ pt: pt, } return result, nil } -// RegenerateKey - Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the same time. -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRClient) regenerateKey(ctx context.Context, resourceGroupName string, resourceName string, parameters RegenerateKeyParameters, options *SignalRBeginRegenerateKeyOptions) (*http.Response, error) { +// RegenerateKey - Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the same +// time. +// If the operation fails it returns an *azcore.ResponseError type. +func (client *Client) regenerateKey(ctx context.Context, resourceGroupName string, resourceName string, parameters RegenerateKeyParameters, options *ClientBeginRegenerateKeyOptions) (*http.Response, error) { req, err := client.regenerateKeyCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { return nil, err @@ -594,13 +533,13 @@ func (client *SignalRClient) regenerateKey(ctx context.Context, resourceGroupNam return nil, err } if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, client.regenerateKeyHandleError(resp) + return nil, runtime.NewResponseError(resp) } return resp, nil } // regenerateKeyCreateRequest creates the RegenerateKey request. -func (client *SignalRClient) regenerateKeyCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters RegenerateKeyParameters, options *SignalRBeginRegenerateKeyOptions) (*policy.Request, error) { +func (client *Client) regenerateKeyCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters RegenerateKeyParameters, options *ClientBeginRegenerateKeyOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/regenerateKey" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -614,7 +553,7 @@ func (client *SignalRClient) regenerateKeyCreateRequest(ctx context.Context, res return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } @@ -625,42 +564,33 @@ func (client *SignalRClient) regenerateKeyCreateRequest(ctx context.Context, res return req, runtime.MarshalAsJSON(req, parameters) } -// regenerateKeyHandleError handles the RegenerateKey error response. -func (client *SignalRClient) regenerateKeyHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := ErrorResponse{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // BeginRestart - Operation to restart a resource. -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRClient) BeginRestart(ctx context.Context, resourceGroupName string, resourceName string, options *SignalRBeginRestartOptions) (SignalRRestartPollerResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// resourceName - The name of the resource. +// options - ClientBeginRestartOptions contains the optional parameters for the Client.BeginRestart method. +func (client *Client) BeginRestart(ctx context.Context, resourceGroupName string, resourceName string, options *ClientBeginRestartOptions) (ClientRestartPollerResponse, error) { resp, err := client.restart(ctx, resourceGroupName, resourceName, options) if err != nil { - return SignalRRestartPollerResponse{}, err + return ClientRestartPollerResponse{}, err } - result := SignalRRestartPollerResponse{ + result := ClientRestartPollerResponse{ RawResponse: resp, } - pt, err := armruntime.NewPoller("SignalRClient.Restart", "azure-async-operation", resp, client.pl, client.restartHandleError) + pt, err := armruntime.NewPoller("Client.Restart", "azure-async-operation", resp, client.pl) if err != nil { - return SignalRRestartPollerResponse{}, err + return ClientRestartPollerResponse{}, err } - result.Poller = &SignalRRestartPoller{ + result.Poller = &ClientRestartPoller{ pt: pt, } return result, nil } // Restart - Operation to restart a resource. -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRClient) restart(ctx context.Context, resourceGroupName string, resourceName string, options *SignalRBeginRestartOptions) (*http.Response, error) { +// If the operation fails it returns an *azcore.ResponseError type. +func (client *Client) restart(ctx context.Context, resourceGroupName string, resourceName string, options *ClientBeginRestartOptions) (*http.Response, error) { req, err := client.restartCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return nil, err @@ -670,13 +600,13 @@ func (client *SignalRClient) restart(ctx context.Context, resourceGroupName stri return nil, err } if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, client.restartHandleError(resp) + return nil, runtime.NewResponseError(resp) } return resp, nil } // restartCreateRequest creates the Restart request. -func (client *SignalRClient) restartCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *SignalRBeginRestartOptions) (*policy.Request, error) { +func (client *Client) restartCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ClientBeginRestartOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/restart" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -690,7 +620,7 @@ func (client *SignalRClient) restartCreateRequest(ctx context.Context, resourceG return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } @@ -701,42 +631,34 @@ func (client *SignalRClient) restartCreateRequest(ctx context.Context, resourceG return req, nil } -// restartHandleError handles the Restart error response. -func (client *SignalRClient) restartHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := ErrorResponse{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // BeginUpdate - Operation to update an exiting resource. -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRClient) BeginUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters SignalRResource, options *SignalRBeginUpdateOptions) (SignalRUpdatePollerResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// resourceName - The name of the resource. +// parameters - Parameters for the update operation +// options - ClientBeginUpdateOptions contains the optional parameters for the Client.BeginUpdate method. +func (client *Client) BeginUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters ResourceInfo, options *ClientBeginUpdateOptions) (ClientUpdatePollerResponse, error) { resp, err := client.update(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { - return SignalRUpdatePollerResponse{}, err + return ClientUpdatePollerResponse{}, err } - result := SignalRUpdatePollerResponse{ + result := ClientUpdatePollerResponse{ RawResponse: resp, } - pt, err := armruntime.NewPoller("SignalRClient.Update", "", resp, client.pl, client.updateHandleError) + pt, err := armruntime.NewPoller("Client.Update", "", resp, client.pl) if err != nil { - return SignalRUpdatePollerResponse{}, err + return ClientUpdatePollerResponse{}, err } - result.Poller = &SignalRUpdatePoller{ + result.Poller = &ClientUpdatePoller{ pt: pt, } return result, nil } // Update - Operation to update an exiting resource. -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRClient) update(ctx context.Context, resourceGroupName string, resourceName string, parameters SignalRResource, options *SignalRBeginUpdateOptions) (*http.Response, error) { +// If the operation fails it returns an *azcore.ResponseError type. +func (client *Client) update(ctx context.Context, resourceGroupName string, resourceName string, parameters ResourceInfo, options *ClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { return nil, err @@ -746,13 +668,13 @@ func (client *SignalRClient) update(ctx context.Context, resourceGroupName strin return nil, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, client.updateHandleError(resp) + return nil, runtime.NewResponseError(resp) } return resp, nil } // updateCreateRequest creates the Update request. -func (client *SignalRClient) updateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters SignalRResource, options *SignalRBeginUpdateOptions) (*policy.Request, error) { +func (client *Client) updateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters ResourceInfo, options *ClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -766,7 +688,7 @@ func (client *SignalRClient) updateCreateRequest(ctx context.Context, resourceGr return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } @@ -776,16 +698,3 @@ func (client *SignalRClient) updateCreateRequest(ctx context.Context, resourceGr req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) } - -// updateHandleError handles the Update error response. -func (client *SignalRClient) updateHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := ErrorResponse{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} diff --git a/sdk/resourcemanager/signalr/armsignalr/zz_generated_constants.go b/sdk/resourcemanager/signalr/armsignalr/zz_generated_constants.go index 874dd6de3d78..748833f239ed 100644 --- a/sdk/resourcemanager/signalr/armsignalr/zz_generated_constants.go +++ b/sdk/resourcemanager/signalr/armsignalr/zz_generated_constants.go @@ -9,11 +9,11 @@ package armsignalr const ( - module = "armsignalr" - version = "v0.1.0" + moduleName = "armsignalr" + moduleVersion = "v0.2.0" ) -// ACLAction - Default action when no other rule matches +// ACLAction - Azure Networking ACL Action. type ACLAction string const ( @@ -60,15 +60,15 @@ func (c CreatedByType) ToPtr() *CreatedByType { } // FeatureFlags - FeatureFlags is the supported features of Azure SignalR service. -// * ServiceMode: Flag for backend server for SignalR service. Values allowed: "Default": have your own backend server; "Serverless": your application doesn't -// have a backend server; "Classic": for +// * ServiceMode: Flag for backend server for SignalR service. Values allowed: "Default": have your own backend server; "Serverless": +// your application doesn't have a backend server; "Classic": for // backward compatibility. Support both Default and Serverless mode but not recommended; "PredefinedOnly": for future use. // * EnableConnectivityLogs: "true"/"false", to enable/disable the connectivity log category respectively. // * EnableMessagingLogs: "true"/"false", to enable/disable the connectivity log category respectively. -// * EnableLiveTrace: Live Trace allows you to know what's happening inside Azure SignalR service, it will give you live traces in real time, it will be -// helpful when you developing your own Azure -// SignalR based web application or self-troubleshooting some issues. Please note that live traces are counted as outbound messages that will be charged. -// Values allowed: "true"/"false", to +// * EnableLiveTrace: Live Trace allows you to know what's happening inside Azure SignalR service, it will give you live traces +// in real time, it will be helpful when you developing your own Azure +// SignalR based web application or self-troubleshooting some issues. Please note that live traces are counted as outbound +// messages that will be charged. Values allowed: "true"/"false", to // enable/disable live trace feature. type FeatureFlags string @@ -94,7 +94,7 @@ func (c FeatureFlags) ToPtr() *FeatureFlags { return &c } -// KeyType - The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). +// KeyType - The type of access key. type KeyType string const ( @@ -117,7 +117,7 @@ func (c KeyType) ToPtr() *KeyType { return &c } -// ManagedIdentityType - Represent the identity type: systemAssigned, userAssigned, None +// ManagedIdentityType - Represents the identity type: systemAssigned, userAssigned, None type ManagedIdentityType string const ( @@ -140,7 +140,8 @@ func (c ManagedIdentityType) ToPtr() *ManagedIdentityType { return &c } -// PrivateLinkServiceConnectionStatus - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. +// PrivateLinkServiceConnectionStatus - Indicates whether the connection has been Approved/Rejected/Removed by the owner of +// the service. type PrivateLinkServiceConnectionStatus string const ( @@ -223,7 +224,7 @@ func (c ScaleType) ToPtr() *ScaleType { return &c } -// ServiceKind - The kind of the service - e.g. "SignalR" for "Microsoft.SignalRService/SignalR" +// ServiceKind - The kind of the service, it can be SignalR or RawWebSockets type ServiceKind string const ( @@ -271,7 +272,7 @@ func (c SharedPrivateLinkResourceStatus) ToPtr() *SharedPrivateLinkResourceStatu return &c } -// SignalRRequestType - Allowed request types. The value can be one or more of: ClientConnection, ServerConnection, RESTAPI. +// SignalRRequestType - The incoming request type to the service type SignalRRequestType string const ( @@ -322,7 +323,7 @@ func (c SignalRSKUTier) ToPtr() *SignalRSKUTier { return &c } -// UpstreamAuthType - Gets or sets the type of auth. None or ManagedIdentity is supported now. +// UpstreamAuthType - Upstream auth type enum. type UpstreamAuthType string const ( diff --git a/sdk/resourcemanager/signalr/armsignalr/zz_generated_models.go b/sdk/resourcemanager/signalr/armsignalr/zz_generated_models.go index f39b909447ae..af532efea2c2 100644 --- a/sdk/resourcemanager/signalr/armsignalr/zz_generated_models.go +++ b/sdk/resourcemanager/signalr/armsignalr/zz_generated_models.go @@ -15,6 +15,75 @@ import ( "time" ) +// ClientBeginCreateOrUpdateOptions contains the optional parameters for the Client.BeginCreateOrUpdate method. +type ClientBeginCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ClientBeginDeleteOptions contains the optional parameters for the Client.BeginDelete method. +type ClientBeginDeleteOptions struct { + // placeholder for future optional parameters +} + +// ClientBeginRegenerateKeyOptions contains the optional parameters for the Client.BeginRegenerateKey method. +type ClientBeginRegenerateKeyOptions struct { + // placeholder for future optional parameters +} + +// ClientBeginRestartOptions contains the optional parameters for the Client.BeginRestart method. +type ClientBeginRestartOptions struct { + // placeholder for future optional parameters +} + +// ClientBeginUpdateOptions contains the optional parameters for the Client.BeginUpdate method. +type ClientBeginUpdateOptions struct { + // placeholder for future optional parameters +} + +// ClientCheckNameAvailabilityOptions contains the optional parameters for the Client.CheckNameAvailability method. +type ClientCheckNameAvailabilityOptions struct { + // placeholder for future optional parameters +} + +// ClientGetOptions contains the optional parameters for the Client.Get method. +type ClientGetOptions struct { + // placeholder for future optional parameters +} + +// ClientListByResourceGroupOptions contains the optional parameters for the Client.ListByResourceGroup method. +type ClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ClientListBySubscriptionOptions contains the optional parameters for the Client.ListBySubscription method. +type ClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// ClientListKeysOptions contains the optional parameters for the Client.ListKeys method. +type ClientListKeysOptions struct { + // placeholder for future optional parameters +} + +// ClientListSKUsOptions contains the optional parameters for the Client.ListSKUs method. +type ClientListSKUsOptions struct { + // placeholder for future optional parameters +} + +// CorsSettings - Cross-Origin Resource Sharing (CORS) settings. +type CorsSettings struct { + // Gets or sets the list of origins that should be allowed to make cross-origin calls (for example: http://example.com:12345). + // Use "*" to allow all. If omitted, allow all by default. + AllowedOrigins []*string `json:"allowedOrigins,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type CorsSettings. +func (c CorsSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowedOrigins", c.AllowedOrigins) + return json.Marshal(objectMap) +} + // Dimension - Specifications of the Dimension of metrics. type Dimension struct { // Localized friendly display name of the dimension. @@ -30,57 +99,51 @@ type Dimension struct { ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"` } -// ErrorAdditionalInfo - The resource management error additional info. -type ErrorAdditionalInfo struct { - // READ-ONLY; The additional info. - Info map[string]interface{} `json:"info,omitempty" azure:"ro"` - - // READ-ONLY; The additional info type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ErrorDetail - The error detail. -type ErrorDetail struct { - // READ-ONLY; The error additional info. - AdditionalInfo []*ErrorAdditionalInfo `json:"additionalInfo,omitempty" azure:"ro"` - - // READ-ONLY; The error code. - Code *string `json:"code,omitempty" azure:"ro"` - - // READ-ONLY; The error details. - Details []*ErrorDetail `json:"details,omitempty" azure:"ro"` +// Feature of a resource, which controls the runtime behavior. +type Feature struct { + // REQUIRED; FeatureFlags is the supported features of Azure SignalR service. + // * ServiceMode: Flag for backend server for SignalR service. Values allowed: "Default": have your own backend server; "Serverless": + // your application doesn't have a backend server; "Classic": for + // backward compatibility. Support both Default and Serverless mode but not recommended; "PredefinedOnly": for future use. + // * EnableConnectivityLogs: "true"/"false", to enable/disable the connectivity log category respectively. + // * EnableMessagingLogs: "true"/"false", to enable/disable the connectivity log category respectively. + // * EnableLiveTrace: Live Trace allows you to know what's happening inside Azure SignalR service, it will give you live traces + // in real time, it will be helpful when you developing your own Azure + // SignalR based web application or self-troubleshooting some issues. Please note that live traces are counted as outbound + // messages that will be charged. Values allowed: "true"/"false", to + // enable/disable live trace feature. + Flag *FeatureFlags `json:"flag,omitempty"` - // READ-ONLY; The error message. - Message *string `json:"message,omitempty" azure:"ro"` + // REQUIRED; Value of the feature flag. See Azure SignalR service document https://docs.microsoft.com/azure/azure-signalr/ + // for allowed values. + Value *string `json:"value,omitempty"` - // READ-ONLY; The error target. - Target *string `json:"target,omitempty" azure:"ro"` + // Optional properties related to this feature. + Properties map[string]*string `json:"properties,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. -func (e ErrorDetail) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Feature. +func (f Feature) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "additionalInfo", e.AdditionalInfo) - populate(objectMap, "code", e.Code) - populate(objectMap, "details", e.Details) - populate(objectMap, "message", e.Message) - populate(objectMap, "target", e.Target) + populate(objectMap, "flag", f.Flag) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "value", f.Value) return json.Marshal(objectMap) } -// ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData -// error response format.). -// Implements the error and azcore.HTTPResponse interfaces. -type ErrorResponse struct { - raw string - // The error object. - InnerError *ErrorDetail `json:"error,omitempty"` -} +// Keys - A class represents the access keys of the resource. +type Keys struct { + // Connection string constructed via the primaryKey + PrimaryConnectionString *string `json:"primaryConnectionString,omitempty"` + + // The primary access key. + PrimaryKey *string `json:"primaryKey,omitempty"` + + // Connection string constructed via the secondaryKey + SecondaryConnectionString *string `json:"secondaryConnectionString,omitempty"` -// Error implements the error interface for type ErrorResponse. -// The contents of the error text are not contractual and subject to change. -func (e ErrorResponse) Error() string { - return e.raw + // The secondary access key. + SecondaryKey *string `json:"secondaryKey,omitempty"` } // LogSpecification - Specifications of the Logs for Azure Monitoring. @@ -94,7 +157,7 @@ type LogSpecification struct { // ManagedIdentity - A class represent managed identities used for request and response type ManagedIdentity struct { - // Represent the identity type: systemAssigned, userAssigned, None + // Represents the identity type: systemAssigned, userAssigned, None Type *ManagedIdentityType `json:"type,omitempty"` // Get or set the user assigned identities @@ -119,7 +182,8 @@ func (m ManagedIdentity) MarshalJSON() ([]byte, error) { // ManagedIdentitySettings - Managed identity settings for upstream. type ManagedIdentitySettings struct { - // The Resource indicating the App ID URI of the target resource. It also appears in the aud (audience) claim of the issued token. + // The Resource indicating the App ID URI of the target resource. It also appears in the aud (audience) claim of the issued + // token. Resource *string `json:"resource,omitempty"` } @@ -140,9 +204,10 @@ type MetricSpecification struct { // Localized friendly display name of the metric. DisplayName *string `json:"displayName,omitempty"` - // Optional. If set to true, then zero will be returned for time duration where no metric is emitted/published. Ex. a metric that returns the number of - // times a particular error code was emitted. The - // error code may not appear often, instead of the RP publishing 0, Shoebox can auto fill in 0s for time periods where nothing was emitted. + // Optional. If set to true, then zero will be returned for time duration where no metric is emitted/published. Ex. a metric + // that returns the number of times a particular error code was emitted. The + // error code may not appear often, instead of the RP publishing 0, Shoebox can auto fill in 0s for time periods where nothing + // was emitted. FillGapWithZero *string `json:"fillGapWithZero,omitempty"` // Name of the metric. @@ -199,18 +264,35 @@ type NetworkACL struct { // MarshalJSON implements the json.Marshaller interface for type NetworkACL. func (n NetworkACL) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - n.marshalInternal(objectMap) + populate(objectMap, "allow", n.Allow) + populate(objectMap, "deny", n.Deny) return json.Marshal(objectMap) } -func (n NetworkACL) marshalInternal(objectMap map[string]interface{}) { - populate(objectMap, "allow", n.Allow) - populate(objectMap, "deny", n.Deny) +// NetworkACLs - Network ACLs for the resource +type NetworkACLs struct { + // Azure Networking ACL Action. + DefaultAction *ACLAction `json:"defaultAction,omitempty"` + + // ACLs for requests from private endpoints + PrivateEndpoints []*PrivateEndpointACL `json:"privateEndpoints,omitempty"` + + // Network ACL + PublicNetwork *NetworkACL `json:"publicNetwork,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkACLs. +func (n NetworkACLs) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "defaultAction", n.DefaultAction) + populate(objectMap, "privateEndpoints", n.PrivateEndpoints) + populate(objectMap, "publicNetwork", n.PublicNetwork) + return json.Marshal(objectMap) } // Operation - REST API operation supported by resource provider. type Operation struct { - // The object that describes the operation. + // The object that describes a operation. Display *OperationDisplay `json:"display,omitempty"` // If the operation is a data action. (for data plane rbac) @@ -219,10 +301,11 @@ type Operation struct { // Name of the operation with format: {provider}/{resource}/{operation} Name *string `json:"name,omitempty"` - // Optional. The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. + // Optional. The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs + // UX. Origin *string `json:"origin,omitempty"` - // Extra properties for the operation. + // Extra Operation properties. Properties *OperationProperties `json:"properties,omitempty"` } @@ -260,12 +343,12 @@ func (o OperationList) MarshalJSON() ([]byte, error) { // OperationProperties - Extra Operation properties. type OperationProperties struct { - // The service specifications. + // An object that describes a specification. ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` } -// OperationsListOptions contains the optional parameters for the Operations.List method. -type OperationsListOptions struct { +// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +type OperationsClientListOptions struct { // placeholder for future optional parameters } @@ -277,42 +360,47 @@ type PrivateEndpoint struct { // PrivateEndpointACL - ACL for a private endpoint type PrivateEndpointACL struct { - NetworkACL // REQUIRED; Name of the private endpoint connection Name *string `json:"name,omitempty"` + + // Allowed request types. The value can be one or more of: ClientConnection, ServerConnection, RESTAPI. + Allow []*SignalRRequestType `json:"allow,omitempty"` + + // Denied request types. The value can be one or more of: ClientConnection, ServerConnection, RESTAPI. + Deny []*SignalRRequestType `json:"deny,omitempty"` } // MarshalJSON implements the json.Marshaller interface for type PrivateEndpointACL. func (p PrivateEndpointACL) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - p.NetworkACL.marshalInternal(objectMap) + populate(objectMap, "allow", p.Allow) + populate(objectMap, "deny", p.Deny) populate(objectMap, "name", p.Name) return json.Marshal(objectMap) } // PrivateEndpointConnection - A private endpoint connection to an azure resource type PrivateEndpointConnection struct { - ProxyResource - // Properties of the private endpoint connection + // Private endpoint connection properties Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + // READ-ONLY; Fully qualified resource Id for the resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty" azure:"ro"` + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` -} -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. -func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - p.ProxyResource.marshalInternal(objectMap) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "systemData", p.SystemData) - return json.Marshal(objectMap) + // READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR" + Type *string `json:"type,omitempty" azure:"ro"` } // PrivateEndpointConnectionList - A list of private endpoint connections type PrivateEndpointConnectionList struct { - // Request URL that can be used to query next page of private endpoint connections. Returned when the total number of requested private endpoint connections - // exceed maximum page size. + // Request URL that can be used to query next page of private endpoint connections. Returned when the total number of requested + // private endpoint connections exceed maximum page size. NextLink *string `json:"nextLink,omitempty"` // The list of the private endpoint connections @@ -329,16 +417,16 @@ func (p PrivateEndpointConnectionList) MarshalJSON() ([]byte, error) { // PrivateEndpointConnectionProperties - Private endpoint connection properties type PrivateEndpointConnectionProperties struct { - // Private endpoint associated with the private endpoint connection + // Private endpoint PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - // Connection state + // Connection state of the private endpoint connection PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` // READ-ONLY; Group IDs GroupIDs []*string `json:"groupIds,omitempty" azure:"ro"` - // READ-ONLY; Provisioning state of the private endpoint connection + // READ-ONLY; Provisioning state of the resource. ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` } @@ -352,19 +440,43 @@ func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete +// method. +type PrivateEndpointConnectionsClientBeginDeleteOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get +// method. +type PrivateEndpointConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List +// method. +type PrivateEndpointConnectionsClientListOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Update +// method. +type PrivateEndpointConnectionsClientUpdateOptions struct { + // placeholder for future optional parameters +} + // PrivateLinkResource - Private link resource type PrivateLinkResource struct { - ProxyResource - // Properties of a private link resource + // Private link resource properties Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` -} -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. -func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - p.ProxyResource.marshalInternal(objectMap) - populate(objectMap, "properties", p.Properties) - return json.Marshal(objectMap) + // READ-ONLY; Fully qualified resource Id for the resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR" + Type *string `json:"type,omitempty" azure:"ro"` } // PrivateLinkResourceList - Contains a list of PrivateLinkResource and a possible link to query more results @@ -409,6 +521,11 @@ func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.List method. +type PrivateLinkResourcesClientListOptions struct { + // placeholder for future optional parameters +} + // PrivateLinkServiceConnectionState - Connection state of the private endpoint connection type PrivateLinkServiceConnectionState struct { // A message indicating if changes on the service provider require any updates on the consumer. @@ -421,18 +538,109 @@ type PrivateLinkServiceConnectionState struct { Status *PrivateLinkServiceConnectionStatus `json:"status,omitempty"` } -// ProxyResource - The resource model definition for a ARM proxy resource. It will have everything other than required location and tags -type ProxyResource struct { - Resource +// Properties - A class that describes the properties of the resource +type Properties struct { + // Cross-Origin Resource Sharing (CORS) settings. + Cors *CorsSettings `json:"cors,omitempty"` + + // DisableLocalAuth Enable or disable aad auth When set as true, connection with AuthType=aad won't work. + DisableAADAuth *bool `json:"disableAadAuth,omitempty"` + + // DisableLocalAuth Enable or disable local auth with AccessKey When set as true, connection with AccessKey=xxx won't work. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // List of the featureFlags. + // FeatureFlags that are not included in the parameters for the update operation will not be modified. And the response will + // only include featureFlags that are explicitly set. When a featureFlag is not + // explicitly set, its globally default value will be used But keep in mind, the default value doesn't mean "false". It varies + // in terms of different FeatureFlags. + Features []*Feature `json:"features,omitempty"` + + // Network ACLs for the resource + NetworkACLs *NetworkACLs `json:"networkACLs,omitempty"` + + // Enable or disable public network access. Default to "Enabled". When it's Enabled, network ACLs still apply. When it's Disabled, + // public network access is always disabled no matter what you set in + // network ACLs. + PublicNetworkAccess *string `json:"publicNetworkAccess,omitempty"` + + // Resource log configuration of a Microsoft.SignalRService resource. + ResourceLogConfiguration *ResourceLogConfiguration `json:"resourceLogConfiguration,omitempty"` + + // TLS settings for the resource + TLS *TLSSettings `json:"tls,omitempty"` + + // The settings for the Upstream when the service is in server-less mode. + Upstream *ServerlessUpstreamSettings `json:"upstream,omitempty"` + + // READ-ONLY; The publicly accessible IP of the resource. + ExternalIP *string `json:"externalIP,omitempty" azure:"ro"` + + // READ-ONLY; FQDN of the service instance. + HostName *string `json:"hostName,omitempty" azure:"ro"` + + // READ-ONLY; Deprecated. + HostNamePrefix *string `json:"hostNamePrefix,omitempty" azure:"ro"` + + // READ-ONLY; Private endpoint connections to the resource. + PrivateEndpointConnections []*PrivateEndpointConnection `json:"privateEndpointConnections,omitempty" azure:"ro"` + + // READ-ONLY; Provisioning state of the resource. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; The publicly accessible port of the resource which is designed for browser/client side usage. + PublicPort *int32 `json:"publicPort,omitempty" azure:"ro"` + + // READ-ONLY; The publicly accessible port of the resource which is designed for customer server side usage. + ServerPort *int32 `json:"serverPort,omitempty" azure:"ro"` + + // READ-ONLY; The list of shared private link resources. + SharedPrivateLinkResources []*SharedPrivateLinkResource `json:"sharedPrivateLinkResources,omitempty" azure:"ro"` + + // READ-ONLY; Version of the resource. Probably you need the same or higher version of client SDKs. + Version *string `json:"version,omitempty" azure:"ro"` } -func (p ProxyResource) marshalInternal(objectMap map[string]interface{}) { - p.Resource.marshalInternal(objectMap) +// MarshalJSON implements the json.Marshaller interface for type Properties. +func (p Properties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "cors", p.Cors) + populate(objectMap, "disableAadAuth", p.DisableAADAuth) + populate(objectMap, "disableLocalAuth", p.DisableLocalAuth) + populate(objectMap, "externalIP", p.ExternalIP) + populate(objectMap, "features", p.Features) + populate(objectMap, "hostName", p.HostName) + populate(objectMap, "hostNamePrefix", p.HostNamePrefix) + populate(objectMap, "networkACLs", p.NetworkACLs) + populate(objectMap, "privateEndpointConnections", p.PrivateEndpointConnections) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "publicNetworkAccess", p.PublicNetworkAccess) + populate(objectMap, "publicPort", p.PublicPort) + populate(objectMap, "resourceLogConfiguration", p.ResourceLogConfiguration) + populate(objectMap, "serverPort", p.ServerPort) + populate(objectMap, "sharedPrivateLinkResources", p.SharedPrivateLinkResources) + populate(objectMap, "tls", p.TLS) + populate(objectMap, "upstream", p.Upstream) + populate(objectMap, "version", p.Version) + return json.Marshal(objectMap) +} + +// ProxyResource - The resource model definition for a ARM proxy resource. It will have everything other than required location +// and tags +type ProxyResource struct { + // READ-ONLY; Fully qualified resource Id for the resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR" + Type *string `json:"type,omitempty" azure:"ro"` } // RegenerateKeyParameters - Parameters describes the request to regenerate access keys type RegenerateKeyParameters struct { - // The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). + // The type of access key. KeyType *KeyType `json:"keyType,omitempty"` } @@ -448,17 +656,70 @@ type Resource struct { Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - r.marshalInternal(objectMap) - return json.Marshal(objectMap) +// ResourceInfo - A class represent a resource. +type ResourceInfo struct { + // A class represent managed identities used for request and response + Identity *ManagedIdentity `json:"identity,omitempty"` + + // The kind of the service, it can be SignalR or RawWebSockets + Kind *ServiceKind `json:"kind,omitempty"` + + // The GEO location of the resource. e.g. West US | East US | North Central US | South Central US. + Location *string `json:"location,omitempty"` + + // A class that describes the properties of the resource + Properties *Properties `json:"properties,omitempty"` + + // The billing information of the resource. + SKU *ResourceSKU `json:"sku,omitempty"` + + // Tags of the service which is a list of key value pairs that describe the resource. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified resource Id for the resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR" + Type *string `json:"type,omitempty" azure:"ro"` } -func (r Resource) marshalInternal(objectMap map[string]interface{}) { +// MarshalJSON implements the json.Marshaller interface for type ResourceInfo. +func (r ResourceInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) populate(objectMap, "id", r.ID) + populate(objectMap, "identity", r.Identity) + populate(objectMap, "kind", r.Kind) + populate(objectMap, "location", r.Location) populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "sku", r.SKU) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "tags", r.Tags) populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// ResourceInfoList - Object that includes an array of resources and a possible link for next set. +type ResourceInfoList struct { + // The URL the client should use to fetch the next page (per server side paging). It's null for now, added for future use. + NextLink *string `json:"nextLink,omitempty"` + + // List of the resources + Value []*ResourceInfo `json:"value,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceInfoList. +func (r ResourceInfoList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) } // ResourceLogCategory - Resource log category configuration of a Microsoft.SignalRService resource. @@ -506,13 +767,13 @@ type ResourceSKU struct { // SKU - Describes an available sku." type SKU struct { - // READ-ONLY; Specifies the unit of the resource. + // READ-ONLY; Describes scaling information of a sku. Capacity *SKUCapacity `json:"capacity,omitempty" azure:"ro"` // READ-ONLY; The resource type that this object applies to ResourceType *string `json:"resourceType,omitempty" azure:"ro"` - // READ-ONLY; The exact set of keys that define this sku. + // READ-ONLY; The billing information of the resource. SKU *ResourceSKU `json:"sku,omitempty" azure:"ro"` } @@ -547,7 +808,8 @@ func (s SKUCapacity) MarshalJSON() ([]byte, error) { // SKUList - The list skus operation response type SKUList struct { - // READ-ONLY; The URL the client should use to fetch the next page (per server side paging). It's null for now, added for future use. + // READ-ONLY; The URL the client should use to fetch the next page (per server side paging). It's null for now, added for + // future use. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; The list of skus available for the resource. @@ -592,7 +854,8 @@ func (s ServiceSpecification) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// ShareablePrivateLinkResourceProperties - Describes the properties of a resource type that has been onboarded to private link service +// ShareablePrivateLinkResourceProperties - Describes the properties of a resource type that has been onboarded to private +// link service type ShareablePrivateLinkResourceProperties struct { // The description of the resource type that has been onboarded to private link service Description *string `json:"description,omitempty"` @@ -615,27 +878,26 @@ type ShareablePrivateLinkResourceType struct { // SharedPrivateLinkResource - Describes a Shared Private Link Resource type SharedPrivateLinkResource struct { - ProxyResource - // Describes the properties of a Shared Private Link Resource + // Describes the properties of an existing Shared Private Link Resource Properties *SharedPrivateLinkResourceProperties `json:"properties,omitempty"` + // READ-ONLY; Fully qualified resource Id for the resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty" azure:"ro"` + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` -} -// MarshalJSON implements the json.Marshaller interface for type SharedPrivateLinkResource. -func (s SharedPrivateLinkResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - s.ProxyResource.marshalInternal(objectMap) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - return json.Marshal(objectMap) + // READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR" + Type *string `json:"type,omitempty" azure:"ro"` } // SharedPrivateLinkResourceList - A list of shared private link resources type SharedPrivateLinkResourceList struct { - // Request URL that can be used to query next page of private endpoint connections. Returned when the total number of requested private endpoint connections - // exceed maximum page size. + // Request URL that can be used to query next page of private endpoint connections. Returned when the total number of requested + // private endpoint connections exceed maximum page size. NextLink *string `json:"nextLink,omitempty"` // The list of the shared private link resources @@ -661,381 +923,37 @@ type SharedPrivateLinkResourceProperties struct { // The request message for requesting approval of the shared private link resource RequestMessage *string `json:"requestMessage,omitempty"` - // READ-ONLY; Provisioning state of the shared private link resource + // READ-ONLY; Provisioning state of the resource. ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` // READ-ONLY; Status of the shared private link resource Status *SharedPrivateLinkResourceStatus `json:"status,omitempty" azure:"ro"` } -// SignalRBeginCreateOrUpdateOptions contains the optional parameters for the SignalR.BeginCreateOrUpdate method. -type SignalRBeginCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// SignalRBeginDeleteOptions contains the optional parameters for the SignalR.BeginDelete method. -type SignalRBeginDeleteOptions struct { - // placeholder for future optional parameters -} - -// SignalRBeginRegenerateKeyOptions contains the optional parameters for the SignalR.BeginRegenerateKey method. -type SignalRBeginRegenerateKeyOptions struct { - // placeholder for future optional parameters -} - -// SignalRBeginRestartOptions contains the optional parameters for the SignalR.BeginRestart method. -type SignalRBeginRestartOptions struct { - // placeholder for future optional parameters -} - -// SignalRBeginUpdateOptions contains the optional parameters for the SignalR.BeginUpdate method. -type SignalRBeginUpdateOptions struct { - // placeholder for future optional parameters -} - -// SignalRCheckNameAvailabilityOptions contains the optional parameters for the SignalR.CheckNameAvailability method. -type SignalRCheckNameAvailabilityOptions struct { - // placeholder for future optional parameters -} - -// SignalRCorsSettings - Cross-Origin Resource Sharing (CORS) settings. -type SignalRCorsSettings struct { - // Gets or sets the list of origins that should be allowed to make cross-origin calls (for example: http://example.com:12345). Use "*" to allow all. If - // omitted, allow all by default. - AllowedOrigins []*string `json:"allowedOrigins,omitempty"` -} - -// MarshalJSON implements the json.Marshaller interface for type SignalRCorsSettings. -func (s SignalRCorsSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowedOrigins", s.AllowedOrigins) - return json.Marshal(objectMap) -} - -// SignalRFeature - Feature of a resource, which controls the runtime behavior. -type SignalRFeature struct { - // REQUIRED; FeatureFlags is the supported features of Azure SignalR service. - // * ServiceMode: Flag for backend server for SignalR service. Values allowed: "Default": have your own backend server; "Serverless": your application doesn't - // have a backend server; "Classic": for - // backward compatibility. Support both Default and Serverless mode but not recommended; "PredefinedOnly": for future use. - // * EnableConnectivityLogs: "true"/"false", to enable/disable the connectivity log category respectively. - // * EnableMessagingLogs: "true"/"false", to enable/disable the connectivity log category respectively. - // * EnableLiveTrace: Live Trace allows you to know what's happening inside Azure SignalR service, it will give you live traces in real time, it will be - // helpful when you developing your own Azure - // SignalR based web application or self-troubleshooting some issues. Please note that live traces are counted as outbound messages that will be charged. - // Values allowed: "true"/"false", to - // enable/disable live trace feature. - Flag *FeatureFlags `json:"flag,omitempty"` - - // REQUIRED; Value of the feature flag. See Azure SignalR service document https://docs.microsoft.com/azure/azure-signalr/ for allowed values. - Value *string `json:"value,omitempty"` - - // Optional properties related to this feature. - Properties map[string]*string `json:"properties,omitempty"` -} - -// MarshalJSON implements the json.Marshaller interface for type SignalRFeature. -func (s SignalRFeature) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "flag", s.Flag) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// SignalRGetOptions contains the optional parameters for the SignalR.Get method. -type SignalRGetOptions struct { - // placeholder for future optional parameters -} - -// SignalRKeys - A class represents the access keys of the resource. -type SignalRKeys struct { - // Connection string constructed via the primaryKey - PrimaryConnectionString *string `json:"primaryConnectionString,omitempty"` - - // The primary access key. - PrimaryKey *string `json:"primaryKey,omitempty"` - - // Connection string constructed via the secondaryKey - SecondaryConnectionString *string `json:"secondaryConnectionString,omitempty"` - - // The secondary access key. - SecondaryKey *string `json:"secondaryKey,omitempty"` -} - -// SignalRListByResourceGroupOptions contains the optional parameters for the SignalR.ListByResourceGroup method. -type SignalRListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// SignalRListBySubscriptionOptions contains the optional parameters for the SignalR.ListBySubscription method. -type SignalRListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// SignalRListKeysOptions contains the optional parameters for the SignalR.ListKeys method. -type SignalRListKeysOptions struct { - // placeholder for future optional parameters -} - -// SignalRListSKUsOptions contains the optional parameters for the SignalR.ListSKUs method. -type SignalRListSKUsOptions struct { - // placeholder for future optional parameters -} - -// SignalRNetworkACLs - Network ACLs for the resource -type SignalRNetworkACLs struct { - // Default action when no other rule matches - DefaultAction *ACLAction `json:"defaultAction,omitempty"` - - // ACLs for requests from private endpoints - PrivateEndpoints []*PrivateEndpointACL `json:"privateEndpoints,omitempty"` - - // ACL for requests from public network - PublicNetwork *NetworkACL `json:"publicNetwork,omitempty"` -} - -// MarshalJSON implements the json.Marshaller interface for type SignalRNetworkACLs. -func (s SignalRNetworkACLs) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "defaultAction", s.DefaultAction) - populate(objectMap, "privateEndpoints", s.PrivateEndpoints) - populate(objectMap, "publicNetwork", s.PublicNetwork) - return json.Marshal(objectMap) -} - -// SignalRPrivateEndpointConnectionsBeginDeleteOptions contains the optional parameters for the SignalRPrivateEndpointConnections.BeginDelete method. -type SignalRPrivateEndpointConnectionsBeginDeleteOptions struct { - // placeholder for future optional parameters -} - -// SignalRPrivateEndpointConnectionsGetOptions contains the optional parameters for the SignalRPrivateEndpointConnections.Get method. -type SignalRPrivateEndpointConnectionsGetOptions struct { - // placeholder for future optional parameters -} - -// SignalRPrivateEndpointConnectionsListOptions contains the optional parameters for the SignalRPrivateEndpointConnections.List method. -type SignalRPrivateEndpointConnectionsListOptions struct { - // placeholder for future optional parameters -} - -// SignalRPrivateEndpointConnectionsUpdateOptions contains the optional parameters for the SignalRPrivateEndpointConnections.Update method. -type SignalRPrivateEndpointConnectionsUpdateOptions struct { - // placeholder for future optional parameters -} - -// SignalRPrivateLinkResourcesListOptions contains the optional parameters for the SignalRPrivateLinkResources.List method. -type SignalRPrivateLinkResourcesListOptions struct { - // placeholder for future optional parameters -} - -// SignalRProperties - A class that describes the properties of the resource -type SignalRProperties struct { - // Cross-Origin Resource Sharing (CORS) settings. - Cors *SignalRCorsSettings `json:"cors,omitempty"` - - // DisableLocalAuth Enable or disable aad auth When set as true, connection with AuthType=aad won't work. - DisableAADAuth *bool `json:"disableAadAuth,omitempty"` - - // DisableLocalAuth Enable or disable local auth with AccessKey When set as true, connection with AccessKey=xxx won't work. - DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` - - // List of the featureFlags. - // FeatureFlags that are not included in the parameters for the update operation will not be modified. And the response will only include featureFlags that - // are explicitly set. When a featureFlag is not - // explicitly set, its globally default value will be used But keep in mind, the default value doesn't mean "false". It varies in terms of different FeatureFlags. - Features []*SignalRFeature `json:"features,omitempty"` - - // Network ACLs - NetworkACLs *SignalRNetworkACLs `json:"networkACLs,omitempty"` - - // Enable or disable public network access. Default to "Enabled". When it's Enabled, network ACLs still apply. When it's Disabled, public network access - // is always disabled no matter what you set in - // network ACLs. - PublicNetworkAccess *string `json:"publicNetworkAccess,omitempty"` - - // Resource log configuration of a Microsoft.SignalRService resource. If resourceLogConfiguration isn't null or empty, it will override options "EnableConnectivityLog" - // and "EnableMessagingLogs" in - // features. Otherwise, use options "EnableConnectivityLog" and "EnableMessagingLogs" in features. - ResourceLogConfiguration *ResourceLogConfiguration `json:"resourceLogConfiguration,omitempty"` - - // TLS settings. - TLS *SignalRTLSSettings `json:"tls,omitempty"` - - // Upstream settings when the service is in server-less mode. - Upstream *ServerlessUpstreamSettings `json:"upstream,omitempty"` - - // READ-ONLY; The publicly accessible IP of the resource. - ExternalIP *string `json:"externalIP,omitempty" azure:"ro"` - - // READ-ONLY; FQDN of the service instance. - HostName *string `json:"hostName,omitempty" azure:"ro"` - - // READ-ONLY; Deprecated. - HostNamePrefix *string `json:"hostNamePrefix,omitempty" azure:"ro"` - - // READ-ONLY; Private endpoint connections to the resource. - PrivateEndpointConnections []*PrivateEndpointConnection `json:"privateEndpointConnections,omitempty" azure:"ro"` - - // READ-ONLY; Provisioning state of the resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - - // READ-ONLY; The publicly accessible port of the resource which is designed for browser/client side usage. - PublicPort *int32 `json:"publicPort,omitempty" azure:"ro"` - - // READ-ONLY; The publicly accessible port of the resource which is designed for customer server side usage. - ServerPort *int32 `json:"serverPort,omitempty" azure:"ro"` - - // READ-ONLY; The list of shared private link resources. - SharedPrivateLinkResources []*SharedPrivateLinkResource `json:"sharedPrivateLinkResources,omitempty" azure:"ro"` - - // READ-ONLY; Version of the resource. Probably you need the same or higher version of client SDKs. - Version *string `json:"version,omitempty" azure:"ro"` -} - -// MarshalJSON implements the json.Marshaller interface for type SignalRProperties. -func (s SignalRProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "cors", s.Cors) - populate(objectMap, "disableAadAuth", s.DisableAADAuth) - populate(objectMap, "disableLocalAuth", s.DisableLocalAuth) - populate(objectMap, "externalIP", s.ExternalIP) - populate(objectMap, "features", s.Features) - populate(objectMap, "hostName", s.HostName) - populate(objectMap, "hostNamePrefix", s.HostNamePrefix) - populate(objectMap, "networkACLs", s.NetworkACLs) - populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) - populate(objectMap, "publicPort", s.PublicPort) - populate(objectMap, "resourceLogConfiguration", s.ResourceLogConfiguration) - populate(objectMap, "serverPort", s.ServerPort) - populate(objectMap, "sharedPrivateLinkResources", s.SharedPrivateLinkResources) - populate(objectMap, "tls", s.TLS) - populate(objectMap, "upstream", s.Upstream) - populate(objectMap, "version", s.Version) - return json.Marshal(objectMap) -} - -// SignalRResource - A class represent a resource. -type SignalRResource struct { - TrackedResource - // The managed identity response - Identity *ManagedIdentity `json:"identity,omitempty"` - - // The kind of the service - e.g. "SignalR" for "Microsoft.SignalRService/SignalR" - Kind *ServiceKind `json:"kind,omitempty"` - - // Settings used to provision or configure the resource - Properties *SignalRProperties `json:"properties,omitempty"` - - // The billing information of the resource.(e.g. Free, Standard) - SKU *ResourceSKU `json:"sku,omitempty"` - - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` -} - -// MarshalJSON implements the json.Marshaller interface for type SignalRResource. -func (s SignalRResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - s.TrackedResource.marshalInternal(objectMap) - populate(objectMap, "identity", s.Identity) - populate(objectMap, "kind", s.Kind) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "sku", s.SKU) - populate(objectMap, "systemData", s.SystemData) - return json.Marshal(objectMap) -} - -// SignalRResourceList - Object that includes an array of resources and a possible link for next set. -type SignalRResourceList struct { - // The URL the client should use to fetch the next page (per server side paging). It's null for now, added for future use. - NextLink *string `json:"nextLink,omitempty"` - - // List of the resources - Value []*SignalRResource `json:"value,omitempty"` -} - -// MarshalJSON implements the json.Marshaller interface for type SignalRResourceList. -func (s SignalRResourceList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// SignalRSharedPrivateLinkResourcesBeginCreateOrUpdateOptions contains the optional parameters for the SignalRSharedPrivateLinkResources.BeginCreateOrUpdate +// SharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.BeginCreateOrUpdate // method. -type SignalRSharedPrivateLinkResourcesBeginCreateOrUpdateOptions struct { +type SharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions struct { // placeholder for future optional parameters } -// SignalRSharedPrivateLinkResourcesBeginDeleteOptions contains the optional parameters for the SignalRSharedPrivateLinkResources.BeginDelete method. -type SignalRSharedPrivateLinkResourcesBeginDeleteOptions struct { +// SharedPrivateLinkResourcesClientBeginDeleteOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.BeginDelete +// method. +type SharedPrivateLinkResourcesClientBeginDeleteOptions struct { // placeholder for future optional parameters } -// SignalRSharedPrivateLinkResourcesGetOptions contains the optional parameters for the SignalRSharedPrivateLinkResources.Get method. -type SignalRSharedPrivateLinkResourcesGetOptions struct { +// SharedPrivateLinkResourcesClientGetOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.Get +// method. +type SharedPrivateLinkResourcesClientGetOptions struct { // placeholder for future optional parameters } -// SignalRSharedPrivateLinkResourcesListOptions contains the optional parameters for the SignalRSharedPrivateLinkResources.List method. -type SignalRSharedPrivateLinkResourcesListOptions struct { +// SharedPrivateLinkResourcesClientListOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.List +// method. +type SharedPrivateLinkResourcesClientListOptions struct { // placeholder for future optional parameters } -// SignalRTLSSettings - TLS settings for the resource -type SignalRTLSSettings struct { - // Request client certificate during TLS handshake if enabled - ClientCertEnabled *bool `json:"clientCertEnabled,omitempty"` -} - -// SignalRUsage - Object that describes a specific usage of the resources. -type SignalRUsage struct { - // Current value for the usage quota. - CurrentValue *int64 `json:"currentValue,omitempty"` - - // Fully qualified ARM resource id - ID *string `json:"id,omitempty"` - - // The maximum permitted value for the usage quota. If there is no limit, this value will be -1. - Limit *int64 `json:"limit,omitempty"` - - // Localizable String object containing the name and a localized value. - Name *SignalRUsageName `json:"name,omitempty"` - - // Representing the units of the usage quota. Possible values are: Count, Bytes, Seconds, Percent, CountPerSecond, BytesPerSecond. - Unit *string `json:"unit,omitempty"` -} - -// SignalRUsageList - Object that includes an array of the resource usages and a possible link for next set. -type SignalRUsageList struct { - // The URL the client should use to fetch the next page (per server side paging). It's null for now, added for future use. - NextLink *string `json:"nextLink,omitempty"` - - // List of the resource usages - Value []*SignalRUsage `json:"value,omitempty"` -} - -// MarshalJSON implements the json.Marshaller interface for type SignalRUsageList. -func (s SignalRUsageList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// SignalRUsageName - Localizable String object containing the name and a localized value. -type SignalRUsageName struct { - // Localized name of the usage. - LocalizedValue *string `json:"localizedValue,omitempty"` - - // The identifier of the usage. - Value *string `json:"value,omitempty"` -} - // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). @@ -1104,71 +1022,128 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { return nil } +// TLSSettings - TLS settings for the resource +type TLSSettings struct { + // Request client certificate during TLS handshake if enabled + ClientCertEnabled *bool `json:"clientCertEnabled,omitempty"` +} + // TrackedResource - The resource model definition for a ARM tracked top level resource. type TrackedResource struct { - Resource // The GEO location of the resource. e.g. West US | East US | North Central US | South Central US. Location *string `json:"location,omitempty"` // Tags of the service which is a list of key value pairs that describe the resource. Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified resource Id for the resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR" + Type *string `json:"type,omitempty" azure:"ro"` } // MarshalJSON implements the json.Marshaller interface for type TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - t.marshalInternal(objectMap) - return json.Marshal(objectMap) -} - -func (t TrackedResource) marshalInternal(objectMap map[string]interface{}) { - t.Resource.marshalInternal(objectMap) + populate(objectMap, "id", t.ID) populate(objectMap, "location", t.Location) + populate(objectMap, "name", t.Name) populate(objectMap, "tags", t.Tags) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) } -// UpstreamAuthSettings - Upstream auth settings. +// UpstreamAuthSettings - Upstream auth settings. If not set, no auth is used for upstream messages. type UpstreamAuthSettings struct { - // Gets or sets the managed identity settings. It's required if the auth type is set to ManagedIdentity. + // Managed identity settings for upstream. ManagedIdentity *ManagedIdentitySettings `json:"managedIdentity,omitempty"` - // Gets or sets the type of auth. None or ManagedIdentity is supported now. + // Upstream auth type enum. Type *UpstreamAuthType `json:"type,omitempty"` } -// UpstreamTemplate - Upstream template item settings. It defines the Upstream URL of the incoming requests. The template defines the pattern of the event, -// the hub or the category of the incoming request that matches +// UpstreamTemplate - Upstream template item settings. It defines the Upstream URL of the incoming requests. The template +// defines the pattern of the event, the hub or the category of the incoming request that matches // current URL template. type UpstreamTemplate struct { - // REQUIRED; Gets or sets the Upstream URL template. You can use 3 predefined parameters {hub}, {category} {event} inside the template, the value of the - // Upstream URL is dynamically calculated when the client - // request comes in. For example, if the urlTemplate is http://example.com/{hub}/api/{event}, with a client request from hub chat connects, it will first - // POST to this URL: + // REQUIRED; Gets or sets the Upstream URL template. You can use 3 predefined parameters {hub}, {category} {event} inside + // the template, the value of the Upstream URL is dynamically calculated when the client + // request comes in. For example, if the urlTemplate is http://example.com/{hub}/api/{event}, with a client request from hub + // chat connects, it will first POST to this URL: // http://example.com/chat/api/connect. URLTemplate *string `json:"urlTemplate,omitempty"` - // Gets or sets the auth settings for an upstream. If not set, no auth is used for upstream messages. + // Upstream auth settings. If not set, no auth is used for upstream messages. Auth *UpstreamAuthSettings `json:"auth,omitempty"` - // Gets or sets the matching pattern for category names. If not set, it matches any category. There are 3 kind of patterns supported: 1. "*", it to matches - // any category name 2. Combine multiple - // categories with ",", for example "connections,messages", it matches category "connections" and "messages" 3. The single category name, for example, "connections", - // it matches the category "connections" + // Gets or sets the matching pattern for category names. If not set, it matches any category. There are 3 kind of patterns + // supported: 1. "*", it to matches any category name 2. Combine multiple + // categories with ",", for example "connections,messages", it matches category "connections" and "messages" 3. The single + // category name, for example, "connections", it matches the category "connections" CategoryPattern *string `json:"categoryPattern,omitempty"` - // Gets or sets the matching pattern for event names. If not set, it matches any event. There are 3 kind of patterns supported: 1. "*", it to matches any - // event name 2. Combine multiple events with ",", - // for example "connect,disconnect", it matches event "connect" and "disconnect" 3. The single event name, for example, "connect", it matches "connect" + // Gets or sets the matching pattern for event names. If not set, it matches any event. There are 3 kind of patterns supported: + // 1. "*", it to matches any event name 2. Combine multiple events with ",", + // for example "connect,disconnect", it matches event "connect" and "disconnect" 3. The single event name, for example, "connect", + // it matches "connect" EventPattern *string `json:"eventPattern,omitempty"` - // Gets or sets the matching pattern for hub names. If not set, it matches any hub. There are 3 kind of patterns supported: 1. "*", it to matches any hub - // name 2. Combine multiple hubs with ",", for + // Gets or sets the matching pattern for hub names. If not set, it matches any hub. There are 3 kind of patterns supported: + // 1. "*", it to matches any hub name 2. Combine multiple hubs with ",", for // example "hub1,hub2", it matches "hub1" and "hub2" 3. The single hub name, for example, "hub1", it matches "hub1" HubPattern *string `json:"hubPattern,omitempty"` } -// UsagesListOptions contains the optional parameters for the Usages.List method. -type UsagesListOptions struct { +// Usage - Object that describes a specific usage of the resources. +type Usage struct { + // Current value for the usage quota. + CurrentValue *int64 `json:"currentValue,omitempty"` + + // Fully qualified ARM resource id + ID *string `json:"id,omitempty"` + + // The maximum permitted value for the usage quota. If there is no limit, this value will be -1. + Limit *int64 `json:"limit,omitempty"` + + // Localizable String object containing the name and a localized value. + Name *UsageName `json:"name,omitempty"` + + // Representing the units of the usage quota. Possible values are: Count, Bytes, Seconds, Percent, CountPerSecond, BytesPerSecond. + Unit *string `json:"unit,omitempty"` +} + +// UsageList - Object that includes an array of the resource usages and a possible link for next set. +type UsageList struct { + // The URL the client should use to fetch the next page (per server side paging). It's null for now, added for future use. + NextLink *string `json:"nextLink,omitempty"` + + // List of the resource usages + Value []*Usage `json:"value,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type UsageList. +func (u UsageList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", u.NextLink) + populate(objectMap, "value", u.Value) + return json.Marshal(objectMap) +} + +// UsageName - Localizable String object containing the name and a localized value. +type UsageName struct { + // Localized name of the usage. + LocalizedValue *string `json:"localizedValue,omitempty"` + + // The identifier of the usage. + Value *string `json:"value,omitempty"` +} + +// UsagesClientListOptions contains the optional parameters for the UsagesClient.List method. +type UsagesClientListOptions struct { // placeholder for future optional parameters } diff --git a/sdk/resourcemanager/signalr/armsignalr/zz_generated_operations_client.go b/sdk/resourcemanager/signalr/armsignalr/zz_generated_operations_client.go index 4a2a1fda6852..df9202eeaffe 100644 --- a/sdk/resourcemanager/signalr/armsignalr/zz_generated_operations_client.go +++ b/sdk/resourcemanager/signalr/armsignalr/zz_generated_operations_client.go @@ -10,7 +10,6 @@ package armsignalr import ( "context" - "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" @@ -22,40 +21,47 @@ import ( // OperationsClient contains the methods for the Operations group. // Don't use this type directly, use NewOperationsClient() instead. type OperationsClient struct { - ep string - pl runtime.Pipeline + host string + pl runtime.Pipeline } // NewOperationsClient creates a new instance of OperationsClient with the specified values. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) *OperationsClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Host) == 0 { - cp.Host = arm.AzurePublicCloud + ep := options.Endpoint + if len(ep) == 0 { + ep = arm.AzurePublicCloud } - return &OperationsClient{ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} + client := &OperationsClient{ + host: string(ep), + pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + } + return client } // List - Lists all of the available REST API operations of the Microsoft.SignalRService provider. -// If the operation fails it returns the *ErrorResponse error type. -func (client *OperationsClient) List(options *OperationsListOptions) *OperationsListPager { - return &OperationsListPager{ +// If the operation fails it returns an *azcore.ResponseError type. +// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +func (client *OperationsClient) List(options *OperationsClientListOptions) *OperationsClientListPager { + return &OperationsClientListPager{ client: client, requester: func(ctx context.Context) (*policy.Request, error) { return client.listCreateRequest(ctx, options) }, - advancer: func(ctx context.Context, resp OperationsListResponse) (*policy.Request, error) { + advancer: func(ctx context.Context, resp OperationsClientListResponse) (*policy.Request, error) { return runtime.NewRequest(ctx, http.MethodGet, *resp.OperationList.NextLink) }, } } // listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsListOptions) (*policy.Request, error) { +func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.SignalRService/operations" - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } @@ -67,23 +73,10 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * } // listHandleResponse handles the List response. -func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsListResponse, error) { - result := OperationsListResponse{RawResponse: resp} +func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { + result := OperationsClientListResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.OperationList); err != nil { - return OperationsListResponse{}, runtime.NewResponseError(err, resp) + return OperationsClientListResponse{}, err } return result, nil } - -// listHandleError handles the List error response. -func (client *OperationsClient) listHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := ErrorResponse{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} diff --git a/sdk/resourcemanager/signalr/armsignalr/zz_generated_pagers.go b/sdk/resourcemanager/signalr/armsignalr/zz_generated_pagers.go index f416bb8869b3..ba53000a46b3 100644 --- a/sdk/resourcemanager/signalr/armsignalr/zz_generated_pagers.go +++ b/sdk/resourcemanager/signalr/armsignalr/zz_generated_pagers.go @@ -16,27 +16,27 @@ import ( "reflect" ) -// OperationsListPager provides operations for iterating over paged responses. -type OperationsListPager struct { - client *OperationsClient - current OperationsListResponse +// ClientListByResourceGroupPager provides operations for iterating over paged responses. +type ClientListByResourceGroupPager struct { + client *Client + current ClientListByResourceGroupResponse err error requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, OperationsListResponse) (*policy.Request, error) + advancer func(context.Context, ClientListByResourceGroupResponse) (*policy.Request, error) } // Err returns the last error encountered while paging. -func (p *OperationsListPager) Err() error { +func (p *ClientListByResourceGroupPager) Err() error { return p.err } // NextPage returns true if the pager advanced to the next page. // Returns false if there are no more pages or an error occurred. -func (p *OperationsListPager) NextPage(ctx context.Context) bool { +func (p *ClientListByResourceGroupPager) NextPage(ctx context.Context) bool { var req *policy.Request var err error if !reflect.ValueOf(p.current).IsZero() { - if p.current.OperationList.NextLink == nil || len(*p.current.OperationList.NextLink) == 0 { + if p.current.ResourceInfoList.NextLink == nil || len(*p.current.ResourceInfoList.NextLink) == 0 { return false } req, err = p.advancer(ctx, p.current) @@ -53,10 +53,10 @@ func (p *OperationsListPager) NextPage(ctx context.Context) bool { return false } if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = p.client.listHandleError(resp) + p.err = runtime.NewResponseError(resp) return false } - result, err := p.client.listHandleResponse(resp) + result, err := p.client.listByResourceGroupHandleResponse(resp) if err != nil { p.err = err return false @@ -65,32 +65,32 @@ func (p *OperationsListPager) NextPage(ctx context.Context) bool { return true } -// PageResponse returns the current OperationsListResponse page. -func (p *OperationsListPager) PageResponse() OperationsListResponse { +// PageResponse returns the current ClientListByResourceGroupResponse page. +func (p *ClientListByResourceGroupPager) PageResponse() ClientListByResourceGroupResponse { return p.current } -// SignalRListByResourceGroupPager provides operations for iterating over paged responses. -type SignalRListByResourceGroupPager struct { - client *SignalRClient - current SignalRListByResourceGroupResponse +// ClientListBySubscriptionPager provides operations for iterating over paged responses. +type ClientListBySubscriptionPager struct { + client *Client + current ClientListBySubscriptionResponse err error requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, SignalRListByResourceGroupResponse) (*policy.Request, error) + advancer func(context.Context, ClientListBySubscriptionResponse) (*policy.Request, error) } // Err returns the last error encountered while paging. -func (p *SignalRListByResourceGroupPager) Err() error { +func (p *ClientListBySubscriptionPager) Err() error { return p.err } // NextPage returns true if the pager advanced to the next page. // Returns false if there are no more pages or an error occurred. -func (p *SignalRListByResourceGroupPager) NextPage(ctx context.Context) bool { +func (p *ClientListBySubscriptionPager) NextPage(ctx context.Context) bool { var req *policy.Request var err error if !reflect.ValueOf(p.current).IsZero() { - if p.current.SignalRResourceList.NextLink == nil || len(*p.current.SignalRResourceList.NextLink) == 0 { + if p.current.ResourceInfoList.NextLink == nil || len(*p.current.ResourceInfoList.NextLink) == 0 { return false } req, err = p.advancer(ctx, p.current) @@ -107,10 +107,10 @@ func (p *SignalRListByResourceGroupPager) NextPage(ctx context.Context) bool { return false } if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = p.client.listByResourceGroupHandleError(resp) + p.err = runtime.NewResponseError(resp) return false } - result, err := p.client.listByResourceGroupHandleResponse(resp) + result, err := p.client.listBySubscriptionHandleResponse(resp) if err != nil { p.err = err return false @@ -119,32 +119,32 @@ func (p *SignalRListByResourceGroupPager) NextPage(ctx context.Context) bool { return true } -// PageResponse returns the current SignalRListByResourceGroupResponse page. -func (p *SignalRListByResourceGroupPager) PageResponse() SignalRListByResourceGroupResponse { +// PageResponse returns the current ClientListBySubscriptionResponse page. +func (p *ClientListBySubscriptionPager) PageResponse() ClientListBySubscriptionResponse { return p.current } -// SignalRListBySubscriptionPager provides operations for iterating over paged responses. -type SignalRListBySubscriptionPager struct { - client *SignalRClient - current SignalRListBySubscriptionResponse +// OperationsClientListPager provides operations for iterating over paged responses. +type OperationsClientListPager struct { + client *OperationsClient + current OperationsClientListResponse err error requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, SignalRListBySubscriptionResponse) (*policy.Request, error) + advancer func(context.Context, OperationsClientListResponse) (*policy.Request, error) } // Err returns the last error encountered while paging. -func (p *SignalRListBySubscriptionPager) Err() error { +func (p *OperationsClientListPager) Err() error { return p.err } // NextPage returns true if the pager advanced to the next page. // Returns false if there are no more pages or an error occurred. -func (p *SignalRListBySubscriptionPager) NextPage(ctx context.Context) bool { +func (p *OperationsClientListPager) NextPage(ctx context.Context) bool { var req *policy.Request var err error if !reflect.ValueOf(p.current).IsZero() { - if p.current.SignalRResourceList.NextLink == nil || len(*p.current.SignalRResourceList.NextLink) == 0 { + if p.current.OperationList.NextLink == nil || len(*p.current.OperationList.NextLink) == 0 { return false } req, err = p.advancer(ctx, p.current) @@ -161,10 +161,10 @@ func (p *SignalRListBySubscriptionPager) NextPage(ctx context.Context) bool { return false } if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = p.client.listBySubscriptionHandleError(resp) + p.err = runtime.NewResponseError(resp) return false } - result, err := p.client.listBySubscriptionHandleResponse(resp) + result, err := p.client.listHandleResponse(resp) if err != nil { p.err = err return false @@ -173,28 +173,28 @@ func (p *SignalRListBySubscriptionPager) NextPage(ctx context.Context) bool { return true } -// PageResponse returns the current SignalRListBySubscriptionResponse page. -func (p *SignalRListBySubscriptionPager) PageResponse() SignalRListBySubscriptionResponse { +// PageResponse returns the current OperationsClientListResponse page. +func (p *OperationsClientListPager) PageResponse() OperationsClientListResponse { return p.current } -// SignalRPrivateEndpointConnectionsListPager provides operations for iterating over paged responses. -type SignalRPrivateEndpointConnectionsListPager struct { - client *SignalRPrivateEndpointConnectionsClient - current SignalRPrivateEndpointConnectionsListResponse +// PrivateEndpointConnectionsClientListPager provides operations for iterating over paged responses. +type PrivateEndpointConnectionsClientListPager struct { + client *PrivateEndpointConnectionsClient + current PrivateEndpointConnectionsClientListResponse err error requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, SignalRPrivateEndpointConnectionsListResponse) (*policy.Request, error) + advancer func(context.Context, PrivateEndpointConnectionsClientListResponse) (*policy.Request, error) } // Err returns the last error encountered while paging. -func (p *SignalRPrivateEndpointConnectionsListPager) Err() error { +func (p *PrivateEndpointConnectionsClientListPager) Err() error { return p.err } // NextPage returns true if the pager advanced to the next page. // Returns false if there are no more pages or an error occurred. -func (p *SignalRPrivateEndpointConnectionsListPager) NextPage(ctx context.Context) bool { +func (p *PrivateEndpointConnectionsClientListPager) NextPage(ctx context.Context) bool { var req *policy.Request var err error if !reflect.ValueOf(p.current).IsZero() { @@ -215,7 +215,7 @@ func (p *SignalRPrivateEndpointConnectionsListPager) NextPage(ctx context.Contex return false } if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = p.client.listHandleError(resp) + p.err = runtime.NewResponseError(resp) return false } result, err := p.client.listHandleResponse(resp) @@ -227,28 +227,28 @@ func (p *SignalRPrivateEndpointConnectionsListPager) NextPage(ctx context.Contex return true } -// PageResponse returns the current SignalRPrivateEndpointConnectionsListResponse page. -func (p *SignalRPrivateEndpointConnectionsListPager) PageResponse() SignalRPrivateEndpointConnectionsListResponse { +// PageResponse returns the current PrivateEndpointConnectionsClientListResponse page. +func (p *PrivateEndpointConnectionsClientListPager) PageResponse() PrivateEndpointConnectionsClientListResponse { return p.current } -// SignalRPrivateLinkResourcesListPager provides operations for iterating over paged responses. -type SignalRPrivateLinkResourcesListPager struct { - client *SignalRPrivateLinkResourcesClient - current SignalRPrivateLinkResourcesListResponse +// PrivateLinkResourcesClientListPager provides operations for iterating over paged responses. +type PrivateLinkResourcesClientListPager struct { + client *PrivateLinkResourcesClient + current PrivateLinkResourcesClientListResponse err error requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, SignalRPrivateLinkResourcesListResponse) (*policy.Request, error) + advancer func(context.Context, PrivateLinkResourcesClientListResponse) (*policy.Request, error) } // Err returns the last error encountered while paging. -func (p *SignalRPrivateLinkResourcesListPager) Err() error { +func (p *PrivateLinkResourcesClientListPager) Err() error { return p.err } // NextPage returns true if the pager advanced to the next page. // Returns false if there are no more pages or an error occurred. -func (p *SignalRPrivateLinkResourcesListPager) NextPage(ctx context.Context) bool { +func (p *PrivateLinkResourcesClientListPager) NextPage(ctx context.Context) bool { var req *policy.Request var err error if !reflect.ValueOf(p.current).IsZero() { @@ -269,7 +269,7 @@ func (p *SignalRPrivateLinkResourcesListPager) NextPage(ctx context.Context) boo return false } if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = p.client.listHandleError(resp) + p.err = runtime.NewResponseError(resp) return false } result, err := p.client.listHandleResponse(resp) @@ -281,28 +281,28 @@ func (p *SignalRPrivateLinkResourcesListPager) NextPage(ctx context.Context) boo return true } -// PageResponse returns the current SignalRPrivateLinkResourcesListResponse page. -func (p *SignalRPrivateLinkResourcesListPager) PageResponse() SignalRPrivateLinkResourcesListResponse { +// PageResponse returns the current PrivateLinkResourcesClientListResponse page. +func (p *PrivateLinkResourcesClientListPager) PageResponse() PrivateLinkResourcesClientListResponse { return p.current } -// SignalRSharedPrivateLinkResourcesListPager provides operations for iterating over paged responses. -type SignalRSharedPrivateLinkResourcesListPager struct { - client *SignalRSharedPrivateLinkResourcesClient - current SignalRSharedPrivateLinkResourcesListResponse +// SharedPrivateLinkResourcesClientListPager provides operations for iterating over paged responses. +type SharedPrivateLinkResourcesClientListPager struct { + client *SharedPrivateLinkResourcesClient + current SharedPrivateLinkResourcesClientListResponse err error requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, SignalRSharedPrivateLinkResourcesListResponse) (*policy.Request, error) + advancer func(context.Context, SharedPrivateLinkResourcesClientListResponse) (*policy.Request, error) } // Err returns the last error encountered while paging. -func (p *SignalRSharedPrivateLinkResourcesListPager) Err() error { +func (p *SharedPrivateLinkResourcesClientListPager) Err() error { return p.err } // NextPage returns true if the pager advanced to the next page. // Returns false if there are no more pages or an error occurred. -func (p *SignalRSharedPrivateLinkResourcesListPager) NextPage(ctx context.Context) bool { +func (p *SharedPrivateLinkResourcesClientListPager) NextPage(ctx context.Context) bool { var req *policy.Request var err error if !reflect.ValueOf(p.current).IsZero() { @@ -323,7 +323,7 @@ func (p *SignalRSharedPrivateLinkResourcesListPager) NextPage(ctx context.Contex return false } if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = p.client.listHandleError(resp) + p.err = runtime.NewResponseError(resp) return false } result, err := p.client.listHandleResponse(resp) @@ -335,32 +335,32 @@ func (p *SignalRSharedPrivateLinkResourcesListPager) NextPage(ctx context.Contex return true } -// PageResponse returns the current SignalRSharedPrivateLinkResourcesListResponse page. -func (p *SignalRSharedPrivateLinkResourcesListPager) PageResponse() SignalRSharedPrivateLinkResourcesListResponse { +// PageResponse returns the current SharedPrivateLinkResourcesClientListResponse page. +func (p *SharedPrivateLinkResourcesClientListPager) PageResponse() SharedPrivateLinkResourcesClientListResponse { return p.current } -// UsagesListPager provides operations for iterating over paged responses. -type UsagesListPager struct { +// UsagesClientListPager provides operations for iterating over paged responses. +type UsagesClientListPager struct { client *UsagesClient - current UsagesListResponse + current UsagesClientListResponse err error requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, UsagesListResponse) (*policy.Request, error) + advancer func(context.Context, UsagesClientListResponse) (*policy.Request, error) } // Err returns the last error encountered while paging. -func (p *UsagesListPager) Err() error { +func (p *UsagesClientListPager) Err() error { return p.err } // NextPage returns true if the pager advanced to the next page. // Returns false if there are no more pages or an error occurred. -func (p *UsagesListPager) NextPage(ctx context.Context) bool { +func (p *UsagesClientListPager) NextPage(ctx context.Context) bool { var req *policy.Request var err error if !reflect.ValueOf(p.current).IsZero() { - if p.current.SignalRUsageList.NextLink == nil || len(*p.current.SignalRUsageList.NextLink) == 0 { + if p.current.UsageList.NextLink == nil || len(*p.current.UsageList.NextLink) == 0 { return false } req, err = p.advancer(ctx, p.current) @@ -377,7 +377,7 @@ func (p *UsagesListPager) NextPage(ctx context.Context) bool { return false } if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = p.client.listHandleError(resp) + p.err = runtime.NewResponseError(resp) return false } result, err := p.client.listHandleResponse(resp) @@ -389,7 +389,7 @@ func (p *UsagesListPager) NextPage(ctx context.Context) bool { return true } -// PageResponse returns the current UsagesListResponse page. -func (p *UsagesListPager) PageResponse() UsagesListResponse { +// PageResponse returns the current UsagesClientListResponse page. +func (p *UsagesClientListPager) PageResponse() UsagesClientListResponse { return p.current } diff --git a/sdk/resourcemanager/signalr/armsignalr/zz_generated_pollers.go b/sdk/resourcemanager/signalr/armsignalr/zz_generated_pollers.go index 08012aee1c2f..f485af82b7fd 100644 --- a/sdk/resourcemanager/signalr/armsignalr/zz_generated_pollers.go +++ b/sdk/resourcemanager/signalr/armsignalr/zz_generated_pollers.go @@ -14,13 +14,13 @@ import ( "net/http" ) -// SignalRCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. -type SignalRCreateOrUpdatePoller struct { +// ClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. +type ClientCreateOrUpdatePoller struct { pt *azcore.Poller } // Done returns true if the LRO has reached a terminal state. -func (p *SignalRCreateOrUpdatePoller) Done() bool { +func (p *ClientCreateOrUpdatePoller) Done() bool { return p.pt.Done() } @@ -34,18 +34,18 @@ func (p *SignalRCreateOrUpdatePoller) Done() bool { // If Poll fails, the poller's state is unmodified and the error is returned. // Calling Poll on an LRO that has reached a terminal state will return the final // HTTP response or error. -func (p *SignalRCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { +func (p *ClientCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { return p.pt.Poll(ctx) } // FinalResponse performs a final GET to the service and returns the final response // for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final SignalRCreateOrUpdateResponse will be returned. -func (p *SignalRCreateOrUpdatePoller) FinalResponse(ctx context.Context) (SignalRCreateOrUpdateResponse, error) { - respType := SignalRCreateOrUpdateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.SignalRResource) +// If the final GET succeeded then the final ClientCreateOrUpdateResponse will be returned. +func (p *ClientCreateOrUpdatePoller) FinalResponse(ctx context.Context) (ClientCreateOrUpdateResponse, error) { + respType := ClientCreateOrUpdateResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.ResourceInfo) if err != nil { - return SignalRCreateOrUpdateResponse{}, err + return ClientCreateOrUpdateResponse{}, err } respType.RawResponse = resp return respType, nil @@ -53,17 +53,17 @@ func (p *SignalRCreateOrUpdatePoller) FinalResponse(ctx context.Context) (Signal // ResumeToken returns a value representing the poller that can be used to resume // the LRO at a later time. ResumeTokens are unique per service operation. -func (p *SignalRCreateOrUpdatePoller) ResumeToken() (string, error) { +func (p *ClientCreateOrUpdatePoller) ResumeToken() (string, error) { return p.pt.ResumeToken() } -// SignalRDeletePoller provides polling facilities until the operation reaches a terminal state. -type SignalRDeletePoller struct { +// ClientDeletePoller provides polling facilities until the operation reaches a terminal state. +type ClientDeletePoller struct { pt *azcore.Poller } // Done returns true if the LRO has reached a terminal state. -func (p *SignalRDeletePoller) Done() bool { +func (p *ClientDeletePoller) Done() bool { return p.pt.Done() } @@ -77,18 +77,18 @@ func (p *SignalRDeletePoller) Done() bool { // If Poll fails, the poller's state is unmodified and the error is returned. // Calling Poll on an LRO that has reached a terminal state will return the final // HTTP response or error. -func (p *SignalRDeletePoller) Poll(ctx context.Context) (*http.Response, error) { +func (p *ClientDeletePoller) Poll(ctx context.Context) (*http.Response, error) { return p.pt.Poll(ctx) } // FinalResponse performs a final GET to the service and returns the final response // for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final SignalRDeleteResponse will be returned. -func (p *SignalRDeletePoller) FinalResponse(ctx context.Context) (SignalRDeleteResponse, error) { - respType := SignalRDeleteResponse{} +// If the final GET succeeded then the final ClientDeleteResponse will be returned. +func (p *ClientDeletePoller) FinalResponse(ctx context.Context) (ClientDeleteResponse, error) { + respType := ClientDeleteResponse{} resp, err := p.pt.FinalResponse(ctx, nil) if err != nil { - return SignalRDeleteResponse{}, err + return ClientDeleteResponse{}, err } respType.RawResponse = resp return respType, nil @@ -96,17 +96,17 @@ func (p *SignalRDeletePoller) FinalResponse(ctx context.Context) (SignalRDeleteR // ResumeToken returns a value representing the poller that can be used to resume // the LRO at a later time. ResumeTokens are unique per service operation. -func (p *SignalRDeletePoller) ResumeToken() (string, error) { +func (p *ClientDeletePoller) ResumeToken() (string, error) { return p.pt.ResumeToken() } -// SignalRPrivateEndpointConnectionsDeletePoller provides polling facilities until the operation reaches a terminal state. -type SignalRPrivateEndpointConnectionsDeletePoller struct { +// ClientRegenerateKeyPoller provides polling facilities until the operation reaches a terminal state. +type ClientRegenerateKeyPoller struct { pt *azcore.Poller } // Done returns true if the LRO has reached a terminal state. -func (p *SignalRPrivateEndpointConnectionsDeletePoller) Done() bool { +func (p *ClientRegenerateKeyPoller) Done() bool { return p.pt.Done() } @@ -120,18 +120,18 @@ func (p *SignalRPrivateEndpointConnectionsDeletePoller) Done() bool { // If Poll fails, the poller's state is unmodified and the error is returned. // Calling Poll on an LRO that has reached a terminal state will return the final // HTTP response or error. -func (p *SignalRPrivateEndpointConnectionsDeletePoller) Poll(ctx context.Context) (*http.Response, error) { +func (p *ClientRegenerateKeyPoller) Poll(ctx context.Context) (*http.Response, error) { return p.pt.Poll(ctx) } // FinalResponse performs a final GET to the service and returns the final response // for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final SignalRPrivateEndpointConnectionsDeleteResponse will be returned. -func (p *SignalRPrivateEndpointConnectionsDeletePoller) FinalResponse(ctx context.Context) (SignalRPrivateEndpointConnectionsDeleteResponse, error) { - respType := SignalRPrivateEndpointConnectionsDeleteResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) +// If the final GET succeeded then the final ClientRegenerateKeyResponse will be returned. +func (p *ClientRegenerateKeyPoller) FinalResponse(ctx context.Context) (ClientRegenerateKeyResponse, error) { + respType := ClientRegenerateKeyResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.Keys) if err != nil { - return SignalRPrivateEndpointConnectionsDeleteResponse{}, err + return ClientRegenerateKeyResponse{}, err } respType.RawResponse = resp return respType, nil @@ -139,17 +139,17 @@ func (p *SignalRPrivateEndpointConnectionsDeletePoller) FinalResponse(ctx contex // ResumeToken returns a value representing the poller that can be used to resume // the LRO at a later time. ResumeTokens are unique per service operation. -func (p *SignalRPrivateEndpointConnectionsDeletePoller) ResumeToken() (string, error) { +func (p *ClientRegenerateKeyPoller) ResumeToken() (string, error) { return p.pt.ResumeToken() } -// SignalRRegenerateKeyPoller provides polling facilities until the operation reaches a terminal state. -type SignalRRegenerateKeyPoller struct { +// ClientRestartPoller provides polling facilities until the operation reaches a terminal state. +type ClientRestartPoller struct { pt *azcore.Poller } // Done returns true if the LRO has reached a terminal state. -func (p *SignalRRegenerateKeyPoller) Done() bool { +func (p *ClientRestartPoller) Done() bool { return p.pt.Done() } @@ -163,18 +163,18 @@ func (p *SignalRRegenerateKeyPoller) Done() bool { // If Poll fails, the poller's state is unmodified and the error is returned. // Calling Poll on an LRO that has reached a terminal state will return the final // HTTP response or error. -func (p *SignalRRegenerateKeyPoller) Poll(ctx context.Context) (*http.Response, error) { +func (p *ClientRestartPoller) Poll(ctx context.Context) (*http.Response, error) { return p.pt.Poll(ctx) } // FinalResponse performs a final GET to the service and returns the final response // for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final SignalRRegenerateKeyResponse will be returned. -func (p *SignalRRegenerateKeyPoller) FinalResponse(ctx context.Context) (SignalRRegenerateKeyResponse, error) { - respType := SignalRRegenerateKeyResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.SignalRKeys) +// If the final GET succeeded then the final ClientRestartResponse will be returned. +func (p *ClientRestartPoller) FinalResponse(ctx context.Context) (ClientRestartResponse, error) { + respType := ClientRestartResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) if err != nil { - return SignalRRegenerateKeyResponse{}, err + return ClientRestartResponse{}, err } respType.RawResponse = resp return respType, nil @@ -182,17 +182,17 @@ func (p *SignalRRegenerateKeyPoller) FinalResponse(ctx context.Context) (SignalR // ResumeToken returns a value representing the poller that can be used to resume // the LRO at a later time. ResumeTokens are unique per service operation. -func (p *SignalRRegenerateKeyPoller) ResumeToken() (string, error) { +func (p *ClientRestartPoller) ResumeToken() (string, error) { return p.pt.ResumeToken() } -// SignalRRestartPoller provides polling facilities until the operation reaches a terminal state. -type SignalRRestartPoller struct { +// ClientUpdatePoller provides polling facilities until the operation reaches a terminal state. +type ClientUpdatePoller struct { pt *azcore.Poller } // Done returns true if the LRO has reached a terminal state. -func (p *SignalRRestartPoller) Done() bool { +func (p *ClientUpdatePoller) Done() bool { return p.pt.Done() } @@ -206,18 +206,18 @@ func (p *SignalRRestartPoller) Done() bool { // If Poll fails, the poller's state is unmodified and the error is returned. // Calling Poll on an LRO that has reached a terminal state will return the final // HTTP response or error. -func (p *SignalRRestartPoller) Poll(ctx context.Context) (*http.Response, error) { +func (p *ClientUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { return p.pt.Poll(ctx) } // FinalResponse performs a final GET to the service and returns the final response // for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final SignalRRestartResponse will be returned. -func (p *SignalRRestartPoller) FinalResponse(ctx context.Context) (SignalRRestartResponse, error) { - respType := SignalRRestartResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) +// If the final GET succeeded then the final ClientUpdateResponse will be returned. +func (p *ClientUpdatePoller) FinalResponse(ctx context.Context) (ClientUpdateResponse, error) { + respType := ClientUpdateResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.ResourceInfo) if err != nil { - return SignalRRestartResponse{}, err + return ClientUpdateResponse{}, err } respType.RawResponse = resp return respType, nil @@ -225,17 +225,17 @@ func (p *SignalRRestartPoller) FinalResponse(ctx context.Context) (SignalRRestar // ResumeToken returns a value representing the poller that can be used to resume // the LRO at a later time. ResumeTokens are unique per service operation. -func (p *SignalRRestartPoller) ResumeToken() (string, error) { +func (p *ClientUpdatePoller) ResumeToken() (string, error) { return p.pt.ResumeToken() } -// SignalRSharedPrivateLinkResourcesCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. -type SignalRSharedPrivateLinkResourcesCreateOrUpdatePoller struct { +// PrivateEndpointConnectionsClientDeletePoller provides polling facilities until the operation reaches a terminal state. +type PrivateEndpointConnectionsClientDeletePoller struct { pt *azcore.Poller } // Done returns true if the LRO has reached a terminal state. -func (p *SignalRSharedPrivateLinkResourcesCreateOrUpdatePoller) Done() bool { +func (p *PrivateEndpointConnectionsClientDeletePoller) Done() bool { return p.pt.Done() } @@ -249,18 +249,18 @@ func (p *SignalRSharedPrivateLinkResourcesCreateOrUpdatePoller) Done() bool { // If Poll fails, the poller's state is unmodified and the error is returned. // Calling Poll on an LRO that has reached a terminal state will return the final // HTTP response or error. -func (p *SignalRSharedPrivateLinkResourcesCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { +func (p *PrivateEndpointConnectionsClientDeletePoller) Poll(ctx context.Context) (*http.Response, error) { return p.pt.Poll(ctx) } // FinalResponse performs a final GET to the service and returns the final response // for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final SignalRSharedPrivateLinkResourcesCreateOrUpdateResponse will be returned. -func (p *SignalRSharedPrivateLinkResourcesCreateOrUpdatePoller) FinalResponse(ctx context.Context) (SignalRSharedPrivateLinkResourcesCreateOrUpdateResponse, error) { - respType := SignalRSharedPrivateLinkResourcesCreateOrUpdateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.SharedPrivateLinkResource) +// If the final GET succeeded then the final PrivateEndpointConnectionsClientDeleteResponse will be returned. +func (p *PrivateEndpointConnectionsClientDeletePoller) FinalResponse(ctx context.Context) (PrivateEndpointConnectionsClientDeleteResponse, error) { + respType := PrivateEndpointConnectionsClientDeleteResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) if err != nil { - return SignalRSharedPrivateLinkResourcesCreateOrUpdateResponse{}, err + return PrivateEndpointConnectionsClientDeleteResponse{}, err } respType.RawResponse = resp return respType, nil @@ -268,17 +268,17 @@ func (p *SignalRSharedPrivateLinkResourcesCreateOrUpdatePoller) FinalResponse(ct // ResumeToken returns a value representing the poller that can be used to resume // the LRO at a later time. ResumeTokens are unique per service operation. -func (p *SignalRSharedPrivateLinkResourcesCreateOrUpdatePoller) ResumeToken() (string, error) { +func (p *PrivateEndpointConnectionsClientDeletePoller) ResumeToken() (string, error) { return p.pt.ResumeToken() } -// SignalRSharedPrivateLinkResourcesDeletePoller provides polling facilities until the operation reaches a terminal state. -type SignalRSharedPrivateLinkResourcesDeletePoller struct { +// SharedPrivateLinkResourcesClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. +type SharedPrivateLinkResourcesClientCreateOrUpdatePoller struct { pt *azcore.Poller } // Done returns true if the LRO has reached a terminal state. -func (p *SignalRSharedPrivateLinkResourcesDeletePoller) Done() bool { +func (p *SharedPrivateLinkResourcesClientCreateOrUpdatePoller) Done() bool { return p.pt.Done() } @@ -292,18 +292,18 @@ func (p *SignalRSharedPrivateLinkResourcesDeletePoller) Done() bool { // If Poll fails, the poller's state is unmodified and the error is returned. // Calling Poll on an LRO that has reached a terminal state will return the final // HTTP response or error. -func (p *SignalRSharedPrivateLinkResourcesDeletePoller) Poll(ctx context.Context) (*http.Response, error) { +func (p *SharedPrivateLinkResourcesClientCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { return p.pt.Poll(ctx) } // FinalResponse performs a final GET to the service and returns the final response // for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final SignalRSharedPrivateLinkResourcesDeleteResponse will be returned. -func (p *SignalRSharedPrivateLinkResourcesDeletePoller) FinalResponse(ctx context.Context) (SignalRSharedPrivateLinkResourcesDeleteResponse, error) { - respType := SignalRSharedPrivateLinkResourcesDeleteResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) +// If the final GET succeeded then the final SharedPrivateLinkResourcesClientCreateOrUpdateResponse will be returned. +func (p *SharedPrivateLinkResourcesClientCreateOrUpdatePoller) FinalResponse(ctx context.Context) (SharedPrivateLinkResourcesClientCreateOrUpdateResponse, error) { + respType := SharedPrivateLinkResourcesClientCreateOrUpdateResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.SharedPrivateLinkResource) if err != nil { - return SignalRSharedPrivateLinkResourcesDeleteResponse{}, err + return SharedPrivateLinkResourcesClientCreateOrUpdateResponse{}, err } respType.RawResponse = resp return respType, nil @@ -311,17 +311,17 @@ func (p *SignalRSharedPrivateLinkResourcesDeletePoller) FinalResponse(ctx contex // ResumeToken returns a value representing the poller that can be used to resume // the LRO at a later time. ResumeTokens are unique per service operation. -func (p *SignalRSharedPrivateLinkResourcesDeletePoller) ResumeToken() (string, error) { +func (p *SharedPrivateLinkResourcesClientCreateOrUpdatePoller) ResumeToken() (string, error) { return p.pt.ResumeToken() } -// SignalRUpdatePoller provides polling facilities until the operation reaches a terminal state. -type SignalRUpdatePoller struct { +// SharedPrivateLinkResourcesClientDeletePoller provides polling facilities until the operation reaches a terminal state. +type SharedPrivateLinkResourcesClientDeletePoller struct { pt *azcore.Poller } // Done returns true if the LRO has reached a terminal state. -func (p *SignalRUpdatePoller) Done() bool { +func (p *SharedPrivateLinkResourcesClientDeletePoller) Done() bool { return p.pt.Done() } @@ -335,18 +335,18 @@ func (p *SignalRUpdatePoller) Done() bool { // If Poll fails, the poller's state is unmodified and the error is returned. // Calling Poll on an LRO that has reached a terminal state will return the final // HTTP response or error. -func (p *SignalRUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { +func (p *SharedPrivateLinkResourcesClientDeletePoller) Poll(ctx context.Context) (*http.Response, error) { return p.pt.Poll(ctx) } // FinalResponse performs a final GET to the service and returns the final response // for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final SignalRUpdateResponse will be returned. -func (p *SignalRUpdatePoller) FinalResponse(ctx context.Context) (SignalRUpdateResponse, error) { - respType := SignalRUpdateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.SignalRResource) +// If the final GET succeeded then the final SharedPrivateLinkResourcesClientDeleteResponse will be returned. +func (p *SharedPrivateLinkResourcesClientDeletePoller) FinalResponse(ctx context.Context) (SharedPrivateLinkResourcesClientDeleteResponse, error) { + respType := SharedPrivateLinkResourcesClientDeleteResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) if err != nil { - return SignalRUpdateResponse{}, err + return SharedPrivateLinkResourcesClientDeleteResponse{}, err } respType.RawResponse = resp return respType, nil @@ -354,6 +354,6 @@ func (p *SignalRUpdatePoller) FinalResponse(ctx context.Context) (SignalRUpdateR // ResumeToken returns a value representing the poller that can be used to resume // the LRO at a later time. ResumeTokens are unique per service operation. -func (p *SignalRUpdatePoller) ResumeToken() (string, error) { +func (p *SharedPrivateLinkResourcesClientDeletePoller) ResumeToken() (string, error) { return p.pt.ResumeToken() } diff --git a/sdk/resourcemanager/signalr/armsignalr/zz_generated_signalrprivateendpointconnections_client.go b/sdk/resourcemanager/signalr/armsignalr/zz_generated_privateendpointconnections_client.go similarity index 51% rename from sdk/resourcemanager/signalr/armsignalr/zz_generated_signalrprivateendpointconnections_client.go rename to sdk/resourcemanager/signalr/armsignalr/zz_generated_privateendpointconnections_client.go index 1a798c923efd..0042b02c32bd 100644 --- a/sdk/resourcemanager/signalr/armsignalr/zz_generated_signalrprivateendpointconnections_client.go +++ b/sdk/resourcemanager/signalr/armsignalr/zz_generated_privateendpointconnections_client.go @@ -11,7 +11,6 @@ package armsignalr import ( "context" "errors" - "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" @@ -22,49 +21,64 @@ import ( "strings" ) -// SignalRPrivateEndpointConnectionsClient contains the methods for the SignalRPrivateEndpointConnections group. -// Don't use this type directly, use NewSignalRPrivateEndpointConnectionsClient() instead. -type SignalRPrivateEndpointConnectionsClient struct { - ep string - pl runtime.Pipeline +// PrivateEndpointConnectionsClient contains the methods for the SignalRPrivateEndpointConnections group. +// Don't use this type directly, use NewPrivateEndpointConnectionsClient() instead. +type PrivateEndpointConnectionsClient struct { + host string subscriptionID string + pl runtime.Pipeline } -// NewSignalRPrivateEndpointConnectionsClient creates a new instance of SignalRPrivateEndpointConnectionsClient with the specified values. -func NewSignalRPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *SignalRPrivateEndpointConnectionsClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options - } - if len(cp.Host) == 0 { - cp.Host = arm.AzurePublicCloud - } - return &SignalRPrivateEndpointConnectionsClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} +// NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. +// subscriptionID - Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *PrivateEndpointConnectionsClient { + if options == nil { + options = &arm.ClientOptions{} + } + ep := options.Endpoint + if len(ep) == 0 { + ep = arm.AzurePublicCloud + } + client := &PrivateEndpointConnectionsClient{ + subscriptionID: subscriptionID, + host: string(ep), + pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + } + return client } // BeginDelete - Delete the specified private endpoint connection -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRPrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName string, options *SignalRPrivateEndpointConnectionsBeginDeleteOptions) (SignalRPrivateEndpointConnectionsDeletePollerResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// privateEndpointConnectionName - The name of the private endpoint connection +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// resourceName - The name of the resource. +// options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete +// method. +func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (PrivateEndpointConnectionsClientDeletePollerResponse, error) { resp, err := client.deleteOperation(ctx, privateEndpointConnectionName, resourceGroupName, resourceName, options) if err != nil { - return SignalRPrivateEndpointConnectionsDeletePollerResponse{}, err + return PrivateEndpointConnectionsClientDeletePollerResponse{}, err } - result := SignalRPrivateEndpointConnectionsDeletePollerResponse{ + result := PrivateEndpointConnectionsClientDeletePollerResponse{ RawResponse: resp, } - pt, err := armruntime.NewPoller("SignalRPrivateEndpointConnectionsClient.Delete", "", resp, client.pl, client.deleteHandleError) + pt, err := armruntime.NewPoller("PrivateEndpointConnectionsClient.Delete", "", resp, client.pl) if err != nil { - return SignalRPrivateEndpointConnectionsDeletePollerResponse{}, err + return PrivateEndpointConnectionsClientDeletePollerResponse{}, err } - result.Poller = &SignalRPrivateEndpointConnectionsDeletePoller{ + result.Poller = &PrivateEndpointConnectionsClientDeletePoller{ pt: pt, } return result, nil } // Delete - Delete the specified private endpoint connection -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRPrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName string, options *SignalRPrivateEndpointConnectionsBeginDeleteOptions) (*http.Response, error) { +// If the operation fails it returns an *azcore.ResponseError type. +func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, privateEndpointConnectionName, resourceGroupName, resourceName, options) if err != nil { return nil, err @@ -74,13 +88,13 @@ func (client *SignalRPrivateEndpointConnectionsClient) deleteOperation(ctx conte return nil, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, client.deleteHandleError(resp) + return nil, runtime.NewResponseError(resp) } return resp, nil } // deleteCreateRequest creates the Delete request. -func (client *SignalRPrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName string, options *SignalRPrivateEndpointConnectionsBeginDeleteOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" if privateEndpointConnectionName == "" { return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") @@ -98,7 +112,7 @@ func (client *SignalRPrivateEndpointConnectionsClient) deleteCreateRequest(ctx c return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } @@ -109,38 +123,31 @@ func (client *SignalRPrivateEndpointConnectionsClient) deleteCreateRequest(ctx c return req, nil } -// deleteHandleError handles the Delete error response. -func (client *SignalRPrivateEndpointConnectionsClient) deleteHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := ErrorResponse{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Get - Get the specified private endpoint connection -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRPrivateEndpointConnectionsClient) Get(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName string, options *SignalRPrivateEndpointConnectionsGetOptions) (SignalRPrivateEndpointConnectionsGetResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// privateEndpointConnectionName - The name of the private endpoint connection +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// resourceName - The name of the resource. +// options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get +// method. +func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, privateEndpointConnectionName, resourceGroupName, resourceName, options) if err != nil { - return SignalRPrivateEndpointConnectionsGetResponse{}, err + return PrivateEndpointConnectionsClientGetResponse{}, err } resp, err := client.pl.Do(req) if err != nil { - return SignalRPrivateEndpointConnectionsGetResponse{}, err + return PrivateEndpointConnectionsClientGetResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return SignalRPrivateEndpointConnectionsGetResponse{}, client.getHandleError(resp) + return PrivateEndpointConnectionsClientGetResponse{}, runtime.NewResponseError(resp) } return client.getHandleResponse(resp) } // getCreateRequest creates the Get request. -func (client *SignalRPrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName string, options *SignalRPrivateEndpointConnectionsGetOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName string, options *PrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" if privateEndpointConnectionName == "" { return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") @@ -158,7 +165,7 @@ func (client *SignalRPrivateEndpointConnectionsClient) getCreateRequest(ctx cont return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } @@ -170,43 +177,35 @@ func (client *SignalRPrivateEndpointConnectionsClient) getCreateRequest(ctx cont } // getHandleResponse handles the Get response. -func (client *SignalRPrivateEndpointConnectionsClient) getHandleResponse(resp *http.Response) (SignalRPrivateEndpointConnectionsGetResponse, error) { - result := SignalRPrivateEndpointConnectionsGetResponse{RawResponse: resp} +func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientGetResponse, error) { + result := PrivateEndpointConnectionsClientGetResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnection); err != nil { - return SignalRPrivateEndpointConnectionsGetResponse{}, runtime.NewResponseError(err, resp) + return PrivateEndpointConnectionsClientGetResponse{}, err } return result, nil } -// getHandleError handles the Get error response. -func (client *SignalRPrivateEndpointConnectionsClient) getHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := ErrorResponse{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // List - List private endpoint connections -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRPrivateEndpointConnectionsClient) List(resourceGroupName string, resourceName string, options *SignalRPrivateEndpointConnectionsListOptions) *SignalRPrivateEndpointConnectionsListPager { - return &SignalRPrivateEndpointConnectionsListPager{ +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// resourceName - The name of the resource. +// options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List +// method. +func (client *PrivateEndpointConnectionsClient) List(resourceGroupName string, resourceName string, options *PrivateEndpointConnectionsClientListOptions) *PrivateEndpointConnectionsClientListPager { + return &PrivateEndpointConnectionsClientListPager{ client: client, requester: func(ctx context.Context) (*policy.Request, error) { return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) }, - advancer: func(ctx context.Context, resp SignalRPrivateEndpointConnectionsListResponse) (*policy.Request, error) { + advancer: func(ctx context.Context, resp PrivateEndpointConnectionsClientListResponse) (*policy.Request, error) { return runtime.NewRequest(ctx, http.MethodGet, *resp.PrivateEndpointConnectionList.NextLink) }, } } // listCreateRequest creates the List request. -func (client *SignalRPrivateEndpointConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *SignalRPrivateEndpointConnectionsListOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *PrivateEndpointConnectionsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/privateEndpointConnections" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -220,7 +219,7 @@ func (client *SignalRPrivateEndpointConnectionsClient) listCreateRequest(ctx con return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } @@ -232,46 +231,40 @@ func (client *SignalRPrivateEndpointConnectionsClient) listCreateRequest(ctx con } // listHandleResponse handles the List response. -func (client *SignalRPrivateEndpointConnectionsClient) listHandleResponse(resp *http.Response) (SignalRPrivateEndpointConnectionsListResponse, error) { - result := SignalRPrivateEndpointConnectionsListResponse{RawResponse: resp} +func (client *PrivateEndpointConnectionsClient) listHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientListResponse, error) { + result := PrivateEndpointConnectionsClientListResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionList); err != nil { - return SignalRPrivateEndpointConnectionsListResponse{}, runtime.NewResponseError(err, resp) + return PrivateEndpointConnectionsClientListResponse{}, err } return result, nil } -// listHandleError handles the List error response. -func (client *SignalRPrivateEndpointConnectionsClient) listHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := ErrorResponse{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Update - Update the state of specified private endpoint connection -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRPrivateEndpointConnectionsClient) Update(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName string, parameters PrivateEndpointConnection, options *SignalRPrivateEndpointConnectionsUpdateOptions) (SignalRPrivateEndpointConnectionsUpdateResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// privateEndpointConnectionName - The name of the private endpoint connection +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// resourceName - The name of the resource. +// parameters - The resource of private endpoint and its properties +// options - PrivateEndpointConnectionsClientUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Update +// method. +func (client *PrivateEndpointConnectionsClient) Update(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientUpdateOptions) (PrivateEndpointConnectionsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, privateEndpointConnectionName, resourceGroupName, resourceName, parameters, options) if err != nil { - return SignalRPrivateEndpointConnectionsUpdateResponse{}, err + return PrivateEndpointConnectionsClientUpdateResponse{}, err } resp, err := client.pl.Do(req) if err != nil { - return SignalRPrivateEndpointConnectionsUpdateResponse{}, err + return PrivateEndpointConnectionsClientUpdateResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return SignalRPrivateEndpointConnectionsUpdateResponse{}, client.updateHandleError(resp) + return PrivateEndpointConnectionsClientUpdateResponse{}, runtime.NewResponseError(resp) } return client.updateHandleResponse(resp) } // updateCreateRequest creates the Update request. -func (client *SignalRPrivateEndpointConnectionsClient) updateCreateRequest(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName string, parameters PrivateEndpointConnection, options *SignalRPrivateEndpointConnectionsUpdateOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" if privateEndpointConnectionName == "" { return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") @@ -289,7 +282,7 @@ func (client *SignalRPrivateEndpointConnectionsClient) updateCreateRequest(ctx c return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } @@ -301,23 +294,10 @@ func (client *SignalRPrivateEndpointConnectionsClient) updateCreateRequest(ctx c } // updateHandleResponse handles the Update response. -func (client *SignalRPrivateEndpointConnectionsClient) updateHandleResponse(resp *http.Response) (SignalRPrivateEndpointConnectionsUpdateResponse, error) { - result := SignalRPrivateEndpointConnectionsUpdateResponse{RawResponse: resp} +func (client *PrivateEndpointConnectionsClient) updateHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientUpdateResponse, error) { + result := PrivateEndpointConnectionsClientUpdateResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnection); err != nil { - return SignalRPrivateEndpointConnectionsUpdateResponse{}, runtime.NewResponseError(err, resp) + return PrivateEndpointConnectionsClientUpdateResponse{}, err } return result, nil } - -// updateHandleError handles the Update error response. -func (client *SignalRPrivateEndpointConnectionsClient) updateHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := ErrorResponse{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} diff --git a/sdk/resourcemanager/signalr/armsignalr/zz_generated_privatelinkresources_client.go b/sdk/resourcemanager/signalr/armsignalr/zz_generated_privatelinkresources_client.go new file mode 100644 index 000000000000..b65ed37b68b8 --- /dev/null +++ b/sdk/resourcemanager/signalr/armsignalr/zz_generated_privatelinkresources_client.go @@ -0,0 +1,105 @@ +//go:build go1.16 +// +build go1.16 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsignalr + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// PrivateLinkResourcesClient contains the methods for the SignalRPrivateLinkResources group. +// Don't use this type directly, use NewPrivateLinkResourcesClient() instead. +type PrivateLinkResourcesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. +// subscriptionID - Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *PrivateLinkResourcesClient { + if options == nil { + options = &arm.ClientOptions{} + } + ep := options.Endpoint + if len(ep) == 0 { + ep = arm.AzurePublicCloud + } + client := &PrivateLinkResourcesClient{ + subscriptionID: subscriptionID, + host: string(ep), + pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + } + return client +} + +// List - Get the private link resources that need to be created for a resource. +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// resourceName - The name of the resource. +// options - PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.List +// method. +func (client *PrivateLinkResourcesClient) List(resourceGroupName string, resourceName string, options *PrivateLinkResourcesClientListOptions) *PrivateLinkResourcesClientListPager { + return &PrivateLinkResourcesClientListPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) + }, + advancer: func(ctx context.Context, resp PrivateLinkResourcesClientListResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.PrivateLinkResourceList.NextLink) + }, + } +} + +// listCreateRequest creates the List request. +func (client *PrivateLinkResourcesClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *PrivateLinkResourcesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/privateLinkResources" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHandleResponse handles the List response. +func (client *PrivateLinkResourcesClient) listHandleResponse(resp *http.Response) (PrivateLinkResourcesClientListResponse, error) { + result := PrivateLinkResourcesClientListResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourceList); err != nil { + return PrivateLinkResourcesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/signalr/armsignalr/zz_generated_response_types.go b/sdk/resourcemanager/signalr/armsignalr/zz_generated_response_types.go index b8da2274883c..87e8a6655a85 100644 --- a/sdk/resourcemanager/signalr/armsignalr/zz_generated_response_types.go +++ b/sdk/resourcemanager/signalr/armsignalr/zz_generated_response_types.go @@ -15,34 +15,22 @@ import ( "time" ) -// OperationsListResponse contains the response from method Operations.List. -type OperationsListResponse struct { - OperationsListResult +// ClientCheckNameAvailabilityResponse contains the response from method Client.CheckNameAvailability. +type ClientCheckNameAvailabilityResponse struct { + ClientCheckNameAvailabilityResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// OperationsListResult contains the result from method Operations.List. -type OperationsListResult struct { - OperationList -} - -// SignalRCheckNameAvailabilityResponse contains the response from method SignalR.CheckNameAvailability. -type SignalRCheckNameAvailabilityResponse struct { - SignalRCheckNameAvailabilityResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// SignalRCheckNameAvailabilityResult contains the result from method SignalR.CheckNameAvailability. -type SignalRCheckNameAvailabilityResult struct { +// ClientCheckNameAvailabilityResult contains the result from method Client.CheckNameAvailability. +type ClientCheckNameAvailabilityResult struct { NameAvailability } -// SignalRCreateOrUpdatePollerResponse contains the response from method SignalR.CreateOrUpdate. -type SignalRCreateOrUpdatePollerResponse struct { +// ClientCreateOrUpdatePollerResponse contains the response from method Client.CreateOrUpdate. +type ClientCreateOrUpdatePollerResponse struct { // Poller contains an initialized poller. - Poller *SignalRCreateOrUpdatePoller + Poller *ClientCreateOrUpdatePoller // RawResponse contains the underlying HTTP response. RawResponse *http.Response @@ -51,9 +39,9 @@ type SignalRCreateOrUpdatePollerResponse struct { // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. // freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. // A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l SignalRCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (SignalRCreateOrUpdateResponse, error) { - respType := SignalRCreateOrUpdateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.SignalRResource) +func (l ClientCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (ClientCreateOrUpdateResponse, error) { + respType := ClientCreateOrUpdateResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.ResourceInfo) if err != nil { return respType, err } @@ -61,13 +49,13 @@ func (l SignalRCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, return respType, nil } -// Resume rehydrates a SignalRCreateOrUpdatePollerResponse from the provided client and resume token. -func (l *SignalRCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *SignalRClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("SignalRClient.CreateOrUpdate", token, client.pl, client.createOrUpdateHandleError) +// Resume rehydrates a ClientCreateOrUpdatePollerResponse from the provided client and resume token. +func (l *ClientCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *Client, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("Client.CreateOrUpdate", token, client.pl) if err != nil { return err } - poller := &SignalRCreateOrUpdatePoller{ + poller := &ClientCreateOrUpdatePoller{ pt: pt, } resp, err := poller.Poll(ctx) @@ -79,22 +67,22 @@ func (l *SignalRCreateOrUpdatePollerResponse) Resume(ctx context.Context, client return nil } -// SignalRCreateOrUpdateResponse contains the response from method SignalR.CreateOrUpdate. -type SignalRCreateOrUpdateResponse struct { - SignalRCreateOrUpdateResult +// ClientCreateOrUpdateResponse contains the response from method Client.CreateOrUpdate. +type ClientCreateOrUpdateResponse struct { + ClientCreateOrUpdateResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// SignalRCreateOrUpdateResult contains the result from method SignalR.CreateOrUpdate. -type SignalRCreateOrUpdateResult struct { - SignalRResource +// ClientCreateOrUpdateResult contains the result from method Client.CreateOrUpdate. +type ClientCreateOrUpdateResult struct { + ResourceInfo } -// SignalRDeletePollerResponse contains the response from method SignalR.Delete. -type SignalRDeletePollerResponse struct { +// ClientDeletePollerResponse contains the response from method Client.Delete. +type ClientDeletePollerResponse struct { // Poller contains an initialized poller. - Poller *SignalRDeletePoller + Poller *ClientDeletePoller // RawResponse contains the underlying HTTP response. RawResponse *http.Response @@ -103,8 +91,8 @@ type SignalRDeletePollerResponse struct { // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. // freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. // A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l SignalRDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (SignalRDeleteResponse, error) { - respType := SignalRDeleteResponse{} +func (l ClientDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (ClientDeleteResponse, error) { + respType := ClientDeleteResponse{} resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) if err != nil { return respType, err @@ -113,13 +101,13 @@ func (l SignalRDeletePollerResponse) PollUntilDone(ctx context.Context, freq tim return respType, nil } -// Resume rehydrates a SignalRDeletePollerResponse from the provided client and resume token. -func (l *SignalRDeletePollerResponse) Resume(ctx context.Context, client *SignalRClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("SignalRClient.Delete", token, client.pl, client.deleteHandleError) +// Resume rehydrates a ClientDeletePollerResponse from the provided client and resume token. +func (l *ClientDeletePollerResponse) Resume(ctx context.Context, client *Client, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("Client.Delete", token, client.pl) if err != nil { return err } - poller := &SignalRDeletePoller{ + poller := &ClientDeletePoller{ pt: pt, } resp, err := poller.Poll(ctx) @@ -131,76 +119,76 @@ func (l *SignalRDeletePollerResponse) Resume(ctx context.Context, client *Signal return nil } -// SignalRDeleteResponse contains the response from method SignalR.Delete. -type SignalRDeleteResponse struct { +// ClientDeleteResponse contains the response from method Client.Delete. +type ClientDeleteResponse struct { // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// SignalRGetResponse contains the response from method SignalR.Get. -type SignalRGetResponse struct { - SignalRGetResult +// ClientGetResponse contains the response from method Client.Get. +type ClientGetResponse struct { + ClientGetResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// SignalRGetResult contains the result from method SignalR.Get. -type SignalRGetResult struct { - SignalRResource +// ClientGetResult contains the result from method Client.Get. +type ClientGetResult struct { + ResourceInfo } -// SignalRListByResourceGroupResponse contains the response from method SignalR.ListByResourceGroup. -type SignalRListByResourceGroupResponse struct { - SignalRListByResourceGroupResult +// ClientListByResourceGroupResponse contains the response from method Client.ListByResourceGroup. +type ClientListByResourceGroupResponse struct { + ClientListByResourceGroupResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// SignalRListByResourceGroupResult contains the result from method SignalR.ListByResourceGroup. -type SignalRListByResourceGroupResult struct { - SignalRResourceList +// ClientListByResourceGroupResult contains the result from method Client.ListByResourceGroup. +type ClientListByResourceGroupResult struct { + ResourceInfoList } -// SignalRListBySubscriptionResponse contains the response from method SignalR.ListBySubscription. -type SignalRListBySubscriptionResponse struct { - SignalRListBySubscriptionResult +// ClientListBySubscriptionResponse contains the response from method Client.ListBySubscription. +type ClientListBySubscriptionResponse struct { + ClientListBySubscriptionResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// SignalRListBySubscriptionResult contains the result from method SignalR.ListBySubscription. -type SignalRListBySubscriptionResult struct { - SignalRResourceList +// ClientListBySubscriptionResult contains the result from method Client.ListBySubscription. +type ClientListBySubscriptionResult struct { + ResourceInfoList } -// SignalRListKeysResponse contains the response from method SignalR.ListKeys. -type SignalRListKeysResponse struct { - SignalRListKeysResult +// ClientListKeysResponse contains the response from method Client.ListKeys. +type ClientListKeysResponse struct { + ClientListKeysResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// SignalRListKeysResult contains the result from method SignalR.ListKeys. -type SignalRListKeysResult struct { - SignalRKeys +// ClientListKeysResult contains the result from method Client.ListKeys. +type ClientListKeysResult struct { + Keys } -// SignalRListSKUsResponse contains the response from method SignalR.ListSKUs. -type SignalRListSKUsResponse struct { - SignalRListSKUsResult +// ClientListSKUsResponse contains the response from method Client.ListSKUs. +type ClientListSKUsResponse struct { + ClientListSKUsResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// SignalRListSKUsResult contains the result from method SignalR.ListSKUs. -type SignalRListSKUsResult struct { +// ClientListSKUsResult contains the result from method Client.ListSKUs. +type ClientListSKUsResult struct { SKUList } -// SignalRPrivateEndpointConnectionsDeletePollerResponse contains the response from method SignalRPrivateEndpointConnections.Delete. -type SignalRPrivateEndpointConnectionsDeletePollerResponse struct { +// ClientRegenerateKeyPollerResponse contains the response from method Client.RegenerateKey. +type ClientRegenerateKeyPollerResponse struct { // Poller contains an initialized poller. - Poller *SignalRPrivateEndpointConnectionsDeletePoller + Poller *ClientRegenerateKeyPoller // RawResponse contains the underlying HTTP response. RawResponse *http.Response @@ -209,9 +197,9 @@ type SignalRPrivateEndpointConnectionsDeletePollerResponse struct { // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. // freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. // A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l SignalRPrivateEndpointConnectionsDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (SignalRPrivateEndpointConnectionsDeleteResponse, error) { - respType := SignalRPrivateEndpointConnectionsDeleteResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) +func (l ClientRegenerateKeyPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (ClientRegenerateKeyResponse, error) { + respType := ClientRegenerateKeyResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.Keys) if err != nil { return respType, err } @@ -219,13 +207,13 @@ func (l SignalRPrivateEndpointConnectionsDeletePollerResponse) PollUntilDone(ctx return respType, nil } -// Resume rehydrates a SignalRPrivateEndpointConnectionsDeletePollerResponse from the provided client and resume token. -func (l *SignalRPrivateEndpointConnectionsDeletePollerResponse) Resume(ctx context.Context, client *SignalRPrivateEndpointConnectionsClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("SignalRPrivateEndpointConnectionsClient.Delete", token, client.pl, client.deleteHandleError) +// Resume rehydrates a ClientRegenerateKeyPollerResponse from the provided client and resume token. +func (l *ClientRegenerateKeyPollerResponse) Resume(ctx context.Context, client *Client, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("Client.RegenerateKey", token, client.pl) if err != nil { return err } - poller := &SignalRPrivateEndpointConnectionsDeletePoller{ + poller := &ClientRegenerateKeyPoller{ pt: pt, } resp, err := poller.Poll(ctx) @@ -237,64 +225,22 @@ func (l *SignalRPrivateEndpointConnectionsDeletePollerResponse) Resume(ctx conte return nil } -// SignalRPrivateEndpointConnectionsDeleteResponse contains the response from method SignalRPrivateEndpointConnections.Delete. -type SignalRPrivateEndpointConnectionsDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// SignalRPrivateEndpointConnectionsGetResponse contains the response from method SignalRPrivateEndpointConnections.Get. -type SignalRPrivateEndpointConnectionsGetResponse struct { - SignalRPrivateEndpointConnectionsGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// SignalRPrivateEndpointConnectionsGetResult contains the result from method SignalRPrivateEndpointConnections.Get. -type SignalRPrivateEndpointConnectionsGetResult struct { - PrivateEndpointConnection -} - -// SignalRPrivateEndpointConnectionsListResponse contains the response from method SignalRPrivateEndpointConnections.List. -type SignalRPrivateEndpointConnectionsListResponse struct { - SignalRPrivateEndpointConnectionsListResult +// ClientRegenerateKeyResponse contains the response from method Client.RegenerateKey. +type ClientRegenerateKeyResponse struct { + ClientRegenerateKeyResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// SignalRPrivateEndpointConnectionsListResult contains the result from method SignalRPrivateEndpointConnections.List. -type SignalRPrivateEndpointConnectionsListResult struct { - PrivateEndpointConnectionList +// ClientRegenerateKeyResult contains the result from method Client.RegenerateKey. +type ClientRegenerateKeyResult struct { + Keys } -// SignalRPrivateEndpointConnectionsUpdateResponse contains the response from method SignalRPrivateEndpointConnections.Update. -type SignalRPrivateEndpointConnectionsUpdateResponse struct { - SignalRPrivateEndpointConnectionsUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// SignalRPrivateEndpointConnectionsUpdateResult contains the result from method SignalRPrivateEndpointConnections.Update. -type SignalRPrivateEndpointConnectionsUpdateResult struct { - PrivateEndpointConnection -} - -// SignalRPrivateLinkResourcesListResponse contains the response from method SignalRPrivateLinkResources.List. -type SignalRPrivateLinkResourcesListResponse struct { - SignalRPrivateLinkResourcesListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// SignalRPrivateLinkResourcesListResult contains the result from method SignalRPrivateLinkResources.List. -type SignalRPrivateLinkResourcesListResult struct { - PrivateLinkResourceList -} - -// SignalRRegenerateKeyPollerResponse contains the response from method SignalR.RegenerateKey. -type SignalRRegenerateKeyPollerResponse struct { +// ClientRestartPollerResponse contains the response from method Client.Restart. +type ClientRestartPollerResponse struct { // Poller contains an initialized poller. - Poller *SignalRRegenerateKeyPoller + Poller *ClientRestartPoller // RawResponse contains the underlying HTTP response. RawResponse *http.Response @@ -303,9 +249,9 @@ type SignalRRegenerateKeyPollerResponse struct { // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. // freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. // A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l SignalRRegenerateKeyPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (SignalRRegenerateKeyResponse, error) { - respType := SignalRRegenerateKeyResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.SignalRKeys) +func (l ClientRestartPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (ClientRestartResponse, error) { + respType := ClientRestartResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) if err != nil { return respType, err } @@ -313,13 +259,13 @@ func (l SignalRRegenerateKeyPollerResponse) PollUntilDone(ctx context.Context, f return respType, nil } -// Resume rehydrates a SignalRRegenerateKeyPollerResponse from the provided client and resume token. -func (l *SignalRRegenerateKeyPollerResponse) Resume(ctx context.Context, client *SignalRClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("SignalRClient.RegenerateKey", token, client.pl, client.regenerateKeyHandleError) +// Resume rehydrates a ClientRestartPollerResponse from the provided client and resume token. +func (l *ClientRestartPollerResponse) Resume(ctx context.Context, client *Client, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("Client.Restart", token, client.pl) if err != nil { return err } - poller := &SignalRRegenerateKeyPoller{ + poller := &ClientRestartPoller{ pt: pt, } resp, err := poller.Poll(ctx) @@ -331,22 +277,16 @@ func (l *SignalRRegenerateKeyPollerResponse) Resume(ctx context.Context, client return nil } -// SignalRRegenerateKeyResponse contains the response from method SignalR.RegenerateKey. -type SignalRRegenerateKeyResponse struct { - SignalRRegenerateKeyResult +// ClientRestartResponse contains the response from method Client.Restart. +type ClientRestartResponse struct { // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// SignalRRegenerateKeyResult contains the result from method SignalR.RegenerateKey. -type SignalRRegenerateKeyResult struct { - SignalRKeys -} - -// SignalRRestartPollerResponse contains the response from method SignalR.Restart. -type SignalRRestartPollerResponse struct { +// ClientUpdatePollerResponse contains the response from method Client.Update. +type ClientUpdatePollerResponse struct { // Poller contains an initialized poller. - Poller *SignalRRestartPoller + Poller *ClientUpdatePoller // RawResponse contains the underlying HTTP response. RawResponse *http.Response @@ -355,9 +295,9 @@ type SignalRRestartPollerResponse struct { // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. // freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. // A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l SignalRRestartPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (SignalRRestartResponse, error) { - respType := SignalRRestartResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) +func (l ClientUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (ClientUpdateResponse, error) { + respType := ClientUpdateResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.ResourceInfo) if err != nil { return respType, err } @@ -365,13 +305,13 @@ func (l SignalRRestartPollerResponse) PollUntilDone(ctx context.Context, freq ti return respType, nil } -// Resume rehydrates a SignalRRestartPollerResponse from the provided client and resume token. -func (l *SignalRRestartPollerResponse) Resume(ctx context.Context, client *SignalRClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("SignalRClient.Restart", token, client.pl, client.restartHandleError) +// Resume rehydrates a ClientUpdatePollerResponse from the provided client and resume token. +func (l *ClientUpdatePollerResponse) Resume(ctx context.Context, client *Client, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("Client.Update", token, client.pl) if err != nil { return err } - poller := &SignalRRestartPoller{ + poller := &ClientUpdatePoller{ pt: pt, } resp, err := poller.Poll(ctx) @@ -383,16 +323,34 @@ func (l *SignalRRestartPollerResponse) Resume(ctx context.Context, client *Signa return nil } -// SignalRRestartResponse contains the response from method SignalR.Restart. -type SignalRRestartResponse struct { +// ClientUpdateResponse contains the response from method Client.Update. +type ClientUpdateResponse struct { + ClientUpdateResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// SignalRSharedPrivateLinkResourcesCreateOrUpdatePollerResponse contains the response from method SignalRSharedPrivateLinkResources.CreateOrUpdate. -type SignalRSharedPrivateLinkResourcesCreateOrUpdatePollerResponse struct { +// ClientUpdateResult contains the result from method Client.Update. +type ClientUpdateResult struct { + ResourceInfo +} + +// OperationsClientListResponse contains the response from method OperationsClient.List. +type OperationsClientListResponse struct { + OperationsClientListResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// OperationsClientListResult contains the result from method OperationsClient.List. +type OperationsClientListResult struct { + OperationList +} + +// PrivateEndpointConnectionsClientDeletePollerResponse contains the response from method PrivateEndpointConnectionsClient.Delete. +type PrivateEndpointConnectionsClientDeletePollerResponse struct { // Poller contains an initialized poller. - Poller *SignalRSharedPrivateLinkResourcesCreateOrUpdatePoller + Poller *PrivateEndpointConnectionsClientDeletePoller // RawResponse contains the underlying HTTP response. RawResponse *http.Response @@ -401,9 +359,9 @@ type SignalRSharedPrivateLinkResourcesCreateOrUpdatePollerResponse struct { // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. // freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. // A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l SignalRSharedPrivateLinkResourcesCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (SignalRSharedPrivateLinkResourcesCreateOrUpdateResponse, error) { - respType := SignalRSharedPrivateLinkResourcesCreateOrUpdateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.SharedPrivateLinkResource) +func (l PrivateEndpointConnectionsClientDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (PrivateEndpointConnectionsClientDeleteResponse, error) { + respType := PrivateEndpointConnectionsClientDeleteResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) if err != nil { return respType, err } @@ -411,13 +369,13 @@ func (l SignalRSharedPrivateLinkResourcesCreateOrUpdatePollerResponse) PollUntil return respType, nil } -// Resume rehydrates a SignalRSharedPrivateLinkResourcesCreateOrUpdatePollerResponse from the provided client and resume token. -func (l *SignalRSharedPrivateLinkResourcesCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *SignalRSharedPrivateLinkResourcesClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("SignalRSharedPrivateLinkResourcesClient.CreateOrUpdate", token, client.pl, client.createOrUpdateHandleError) +// Resume rehydrates a PrivateEndpointConnectionsClientDeletePollerResponse from the provided client and resume token. +func (l *PrivateEndpointConnectionsClientDeletePollerResponse) Resume(ctx context.Context, client *PrivateEndpointConnectionsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("PrivateEndpointConnectionsClient.Delete", token, client.pl) if err != nil { return err } - poller := &SignalRSharedPrivateLinkResourcesCreateOrUpdatePoller{ + poller := &PrivateEndpointConnectionsClientDeletePoller{ pt: pt, } resp, err := poller.Poll(ctx) @@ -429,22 +387,64 @@ func (l *SignalRSharedPrivateLinkResourcesCreateOrUpdatePollerResponse) Resume(c return nil } -// SignalRSharedPrivateLinkResourcesCreateOrUpdateResponse contains the response from method SignalRSharedPrivateLinkResources.CreateOrUpdate. -type SignalRSharedPrivateLinkResourcesCreateOrUpdateResponse struct { - SignalRSharedPrivateLinkResourcesCreateOrUpdateResult +// PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.Delete. +type PrivateEndpointConnectionsClientDeleteResponse struct { // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// SignalRSharedPrivateLinkResourcesCreateOrUpdateResult contains the result from method SignalRSharedPrivateLinkResources.CreateOrUpdate. -type SignalRSharedPrivateLinkResourcesCreateOrUpdateResult struct { - SharedPrivateLinkResource +// PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get. +type PrivateEndpointConnectionsClientGetResponse struct { + PrivateEndpointConnectionsClientGetResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PrivateEndpointConnectionsClientGetResult contains the result from method PrivateEndpointConnectionsClient.Get. +type PrivateEndpointConnectionsClientGetResult struct { + PrivateEndpointConnection +} + +// PrivateEndpointConnectionsClientListResponse contains the response from method PrivateEndpointConnectionsClient.List. +type PrivateEndpointConnectionsClientListResponse struct { + PrivateEndpointConnectionsClientListResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PrivateEndpointConnectionsClientListResult contains the result from method PrivateEndpointConnectionsClient.List. +type PrivateEndpointConnectionsClientListResult struct { + PrivateEndpointConnectionList +} + +// PrivateEndpointConnectionsClientUpdateResponse contains the response from method PrivateEndpointConnectionsClient.Update. +type PrivateEndpointConnectionsClientUpdateResponse struct { + PrivateEndpointConnectionsClientUpdateResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response } -// SignalRSharedPrivateLinkResourcesDeletePollerResponse contains the response from method SignalRSharedPrivateLinkResources.Delete. -type SignalRSharedPrivateLinkResourcesDeletePollerResponse struct { +// PrivateEndpointConnectionsClientUpdateResult contains the result from method PrivateEndpointConnectionsClient.Update. +type PrivateEndpointConnectionsClientUpdateResult struct { + PrivateEndpointConnection +} + +// PrivateLinkResourcesClientListResponse contains the response from method PrivateLinkResourcesClient.List. +type PrivateLinkResourcesClientListResponse struct { + PrivateLinkResourcesClientListResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PrivateLinkResourcesClientListResult contains the result from method PrivateLinkResourcesClient.List. +type PrivateLinkResourcesClientListResult struct { + PrivateLinkResourceList +} + +// SharedPrivateLinkResourcesClientCreateOrUpdatePollerResponse contains the response from method SharedPrivateLinkResourcesClient.CreateOrUpdate. +type SharedPrivateLinkResourcesClientCreateOrUpdatePollerResponse struct { // Poller contains an initialized poller. - Poller *SignalRSharedPrivateLinkResourcesDeletePoller + Poller *SharedPrivateLinkResourcesClientCreateOrUpdatePoller // RawResponse contains the underlying HTTP response. RawResponse *http.Response @@ -453,9 +453,9 @@ type SignalRSharedPrivateLinkResourcesDeletePollerResponse struct { // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. // freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. // A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l SignalRSharedPrivateLinkResourcesDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (SignalRSharedPrivateLinkResourcesDeleteResponse, error) { - respType := SignalRSharedPrivateLinkResourcesDeleteResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) +func (l SharedPrivateLinkResourcesClientCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (SharedPrivateLinkResourcesClientCreateOrUpdateResponse, error) { + respType := SharedPrivateLinkResourcesClientCreateOrUpdateResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.SharedPrivateLinkResource) if err != nil { return respType, err } @@ -463,13 +463,13 @@ func (l SignalRSharedPrivateLinkResourcesDeletePollerResponse) PollUntilDone(ctx return respType, nil } -// Resume rehydrates a SignalRSharedPrivateLinkResourcesDeletePollerResponse from the provided client and resume token. -func (l *SignalRSharedPrivateLinkResourcesDeletePollerResponse) Resume(ctx context.Context, client *SignalRSharedPrivateLinkResourcesClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("SignalRSharedPrivateLinkResourcesClient.Delete", token, client.pl, client.deleteHandleError) +// Resume rehydrates a SharedPrivateLinkResourcesClientCreateOrUpdatePollerResponse from the provided client and resume token. +func (l *SharedPrivateLinkResourcesClientCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *SharedPrivateLinkResourcesClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("SharedPrivateLinkResourcesClient.CreateOrUpdate", token, client.pl) if err != nil { return err } - poller := &SignalRSharedPrivateLinkResourcesDeletePoller{ + poller := &SharedPrivateLinkResourcesClientCreateOrUpdatePoller{ pt: pt, } resp, err := poller.Poll(ctx) @@ -481,40 +481,22 @@ func (l *SignalRSharedPrivateLinkResourcesDeletePollerResponse) Resume(ctx conte return nil } -// SignalRSharedPrivateLinkResourcesDeleteResponse contains the response from method SignalRSharedPrivateLinkResources.Delete. -type SignalRSharedPrivateLinkResourcesDeleteResponse struct { +// SharedPrivateLinkResourcesClientCreateOrUpdateResponse contains the response from method SharedPrivateLinkResourcesClient.CreateOrUpdate. +type SharedPrivateLinkResourcesClientCreateOrUpdateResponse struct { + SharedPrivateLinkResourcesClientCreateOrUpdateResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// SignalRSharedPrivateLinkResourcesGetResponse contains the response from method SignalRSharedPrivateLinkResources.Get. -type SignalRSharedPrivateLinkResourcesGetResponse struct { - SignalRSharedPrivateLinkResourcesGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// SignalRSharedPrivateLinkResourcesGetResult contains the result from method SignalRSharedPrivateLinkResources.Get. -type SignalRSharedPrivateLinkResourcesGetResult struct { +// SharedPrivateLinkResourcesClientCreateOrUpdateResult contains the result from method SharedPrivateLinkResourcesClient.CreateOrUpdate. +type SharedPrivateLinkResourcesClientCreateOrUpdateResult struct { SharedPrivateLinkResource } -// SignalRSharedPrivateLinkResourcesListResponse contains the response from method SignalRSharedPrivateLinkResources.List. -type SignalRSharedPrivateLinkResourcesListResponse struct { - SignalRSharedPrivateLinkResourcesListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// SignalRSharedPrivateLinkResourcesListResult contains the result from method SignalRSharedPrivateLinkResources.List. -type SignalRSharedPrivateLinkResourcesListResult struct { - SharedPrivateLinkResourceList -} - -// SignalRUpdatePollerResponse contains the response from method SignalR.Update. -type SignalRUpdatePollerResponse struct { +// SharedPrivateLinkResourcesClientDeletePollerResponse contains the response from method SharedPrivateLinkResourcesClient.Delete. +type SharedPrivateLinkResourcesClientDeletePollerResponse struct { // Poller contains an initialized poller. - Poller *SignalRUpdatePoller + Poller *SharedPrivateLinkResourcesClientDeletePoller // RawResponse contains the underlying HTTP response. RawResponse *http.Response @@ -523,9 +505,9 @@ type SignalRUpdatePollerResponse struct { // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. // freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. // A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l SignalRUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (SignalRUpdateResponse, error) { - respType := SignalRUpdateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.SignalRResource) +func (l SharedPrivateLinkResourcesClientDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (SharedPrivateLinkResourcesClientDeleteResponse, error) { + respType := SharedPrivateLinkResourcesClientDeleteResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) if err != nil { return respType, err } @@ -533,13 +515,13 @@ func (l SignalRUpdatePollerResponse) PollUntilDone(ctx context.Context, freq tim return respType, nil } -// Resume rehydrates a SignalRUpdatePollerResponse from the provided client and resume token. -func (l *SignalRUpdatePollerResponse) Resume(ctx context.Context, client *SignalRClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("SignalRClient.Update", token, client.pl, client.updateHandleError) +// Resume rehydrates a SharedPrivateLinkResourcesClientDeletePollerResponse from the provided client and resume token. +func (l *SharedPrivateLinkResourcesClientDeletePollerResponse) Resume(ctx context.Context, client *SharedPrivateLinkResourcesClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("SharedPrivateLinkResourcesClient.Delete", token, client.pl) if err != nil { return err } - poller := &SignalRUpdatePoller{ + poller := &SharedPrivateLinkResourcesClientDeletePoller{ pt: pt, } resp, err := poller.Poll(ctx) @@ -551,26 +533,44 @@ func (l *SignalRUpdatePollerResponse) Resume(ctx context.Context, client *Signal return nil } -// SignalRUpdateResponse contains the response from method SignalR.Update. -type SignalRUpdateResponse struct { - SignalRUpdateResult +// SharedPrivateLinkResourcesClientDeleteResponse contains the response from method SharedPrivateLinkResourcesClient.Delete. +type SharedPrivateLinkResourcesClientDeleteResponse struct { // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// SignalRUpdateResult contains the result from method SignalR.Update. -type SignalRUpdateResult struct { - SignalRResource +// SharedPrivateLinkResourcesClientGetResponse contains the response from method SharedPrivateLinkResourcesClient.Get. +type SharedPrivateLinkResourcesClientGetResponse struct { + SharedPrivateLinkResourcesClientGetResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// SharedPrivateLinkResourcesClientGetResult contains the result from method SharedPrivateLinkResourcesClient.Get. +type SharedPrivateLinkResourcesClientGetResult struct { + SharedPrivateLinkResource +} + +// SharedPrivateLinkResourcesClientListResponse contains the response from method SharedPrivateLinkResourcesClient.List. +type SharedPrivateLinkResourcesClientListResponse struct { + SharedPrivateLinkResourcesClientListResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// SharedPrivateLinkResourcesClientListResult contains the result from method SharedPrivateLinkResourcesClient.List. +type SharedPrivateLinkResourcesClientListResult struct { + SharedPrivateLinkResourceList } -// UsagesListResponse contains the response from method Usages.List. -type UsagesListResponse struct { - UsagesListResult +// UsagesClientListResponse contains the response from method UsagesClient.List. +type UsagesClientListResponse struct { + UsagesClientListResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// UsagesListResult contains the result from method Usages.List. -type UsagesListResult struct { - SignalRUsageList +// UsagesClientListResult contains the result from method UsagesClient.List. +type UsagesClientListResult struct { + UsageList } diff --git a/sdk/resourcemanager/signalr/armsignalr/zz_generated_signalrsharedprivatelinkresources_client.go b/sdk/resourcemanager/signalr/armsignalr/zz_generated_sharedprivatelinkresources_client.go similarity index 50% rename from sdk/resourcemanager/signalr/armsignalr/zz_generated_signalrsharedprivatelinkresources_client.go rename to sdk/resourcemanager/signalr/armsignalr/zz_generated_sharedprivatelinkresources_client.go index 43ccac21b62d..bcdc35ff38d7 100644 --- a/sdk/resourcemanager/signalr/armsignalr/zz_generated_signalrsharedprivatelinkresources_client.go +++ b/sdk/resourcemanager/signalr/armsignalr/zz_generated_sharedprivatelinkresources_client.go @@ -11,7 +11,6 @@ package armsignalr import ( "context" "errors" - "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" @@ -22,49 +21,65 @@ import ( "strings" ) -// SignalRSharedPrivateLinkResourcesClient contains the methods for the SignalRSharedPrivateLinkResources group. -// Don't use this type directly, use NewSignalRSharedPrivateLinkResourcesClient() instead. -type SignalRSharedPrivateLinkResourcesClient struct { - ep string - pl runtime.Pipeline +// SharedPrivateLinkResourcesClient contains the methods for the SignalRSharedPrivateLinkResources group. +// Don't use this type directly, use NewSharedPrivateLinkResourcesClient() instead. +type SharedPrivateLinkResourcesClient struct { + host string subscriptionID string + pl runtime.Pipeline } -// NewSignalRSharedPrivateLinkResourcesClient creates a new instance of SignalRSharedPrivateLinkResourcesClient with the specified values. -func NewSignalRSharedPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *SignalRSharedPrivateLinkResourcesClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options - } - if len(cp.Host) == 0 { - cp.Host = arm.AzurePublicCloud - } - return &SignalRSharedPrivateLinkResourcesClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} +// NewSharedPrivateLinkResourcesClient creates a new instance of SharedPrivateLinkResourcesClient with the specified values. +// subscriptionID - Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewSharedPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *SharedPrivateLinkResourcesClient { + if options == nil { + options = &arm.ClientOptions{} + } + ep := options.Endpoint + if len(ep) == 0 { + ep = arm.AzurePublicCloud + } + client := &SharedPrivateLinkResourcesClient{ + subscriptionID: subscriptionID, + host: string(ep), + pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + } + return client } // BeginCreateOrUpdate - Create or update a shared private link resource -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRSharedPrivateLinkResourcesClient) BeginCreateOrUpdate(ctx context.Context, sharedPrivateLinkResourceName string, resourceGroupName string, resourceName string, parameters SharedPrivateLinkResource, options *SignalRSharedPrivateLinkResourcesBeginCreateOrUpdateOptions) (SignalRSharedPrivateLinkResourcesCreateOrUpdatePollerResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// sharedPrivateLinkResourceName - The name of the shared private link resource +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// resourceName - The name of the resource. +// parameters - The shared private link resource +// options - SharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.BeginCreateOrUpdate +// method. +func (client *SharedPrivateLinkResourcesClient) BeginCreateOrUpdate(ctx context.Context, sharedPrivateLinkResourceName string, resourceGroupName string, resourceName string, parameters SharedPrivateLinkResource, options *SharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions) (SharedPrivateLinkResourcesClientCreateOrUpdatePollerResponse, error) { resp, err := client.createOrUpdate(ctx, sharedPrivateLinkResourceName, resourceGroupName, resourceName, parameters, options) if err != nil { - return SignalRSharedPrivateLinkResourcesCreateOrUpdatePollerResponse{}, err + return SharedPrivateLinkResourcesClientCreateOrUpdatePollerResponse{}, err } - result := SignalRSharedPrivateLinkResourcesCreateOrUpdatePollerResponse{ + result := SharedPrivateLinkResourcesClientCreateOrUpdatePollerResponse{ RawResponse: resp, } - pt, err := armruntime.NewPoller("SignalRSharedPrivateLinkResourcesClient.CreateOrUpdate", "", resp, client.pl, client.createOrUpdateHandleError) + pt, err := armruntime.NewPoller("SharedPrivateLinkResourcesClient.CreateOrUpdate", "", resp, client.pl) if err != nil { - return SignalRSharedPrivateLinkResourcesCreateOrUpdatePollerResponse{}, err + return SharedPrivateLinkResourcesClientCreateOrUpdatePollerResponse{}, err } - result.Poller = &SignalRSharedPrivateLinkResourcesCreateOrUpdatePoller{ + result.Poller = &SharedPrivateLinkResourcesClientCreateOrUpdatePoller{ pt: pt, } return result, nil } // CreateOrUpdate - Create or update a shared private link resource -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRSharedPrivateLinkResourcesClient) createOrUpdate(ctx context.Context, sharedPrivateLinkResourceName string, resourceGroupName string, resourceName string, parameters SharedPrivateLinkResource, options *SignalRSharedPrivateLinkResourcesBeginCreateOrUpdateOptions) (*http.Response, error) { +// If the operation fails it returns an *azcore.ResponseError type. +func (client *SharedPrivateLinkResourcesClient) createOrUpdate(ctx context.Context, sharedPrivateLinkResourceName string, resourceGroupName string, resourceName string, parameters SharedPrivateLinkResource, options *SharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, sharedPrivateLinkResourceName, resourceGroupName, resourceName, parameters, options) if err != nil { return nil, err @@ -74,13 +89,13 @@ func (client *SignalRSharedPrivateLinkResourcesClient) createOrUpdate(ctx contex return nil, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, client.createOrUpdateHandleError(resp) + return nil, runtime.NewResponseError(resp) } return resp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *SignalRSharedPrivateLinkResourcesClient) createOrUpdateCreateRequest(ctx context.Context, sharedPrivateLinkResourceName string, resourceGroupName string, resourceName string, parameters SharedPrivateLinkResource, options *SignalRSharedPrivateLinkResourcesBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *SharedPrivateLinkResourcesClient) createOrUpdateCreateRequest(ctx context.Context, sharedPrivateLinkResourceName string, resourceGroupName string, resourceName string, parameters SharedPrivateLinkResource, options *SharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}" if sharedPrivateLinkResourceName == "" { return nil, errors.New("parameter sharedPrivateLinkResourceName cannot be empty") @@ -98,7 +113,7 @@ func (client *SignalRSharedPrivateLinkResourcesClient) createOrUpdateCreateReque return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } @@ -109,42 +124,35 @@ func (client *SignalRSharedPrivateLinkResourcesClient) createOrUpdateCreateReque return req, runtime.MarshalAsJSON(req, parameters) } -// createOrUpdateHandleError handles the CreateOrUpdate error response. -func (client *SignalRSharedPrivateLinkResourcesClient) createOrUpdateHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := ErrorResponse{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // BeginDelete - Delete the specified shared private link resource -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRSharedPrivateLinkResourcesClient) BeginDelete(ctx context.Context, sharedPrivateLinkResourceName string, resourceGroupName string, resourceName string, options *SignalRSharedPrivateLinkResourcesBeginDeleteOptions) (SignalRSharedPrivateLinkResourcesDeletePollerResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// sharedPrivateLinkResourceName - The name of the shared private link resource +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// resourceName - The name of the resource. +// options - SharedPrivateLinkResourcesClientBeginDeleteOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.BeginDelete +// method. +func (client *SharedPrivateLinkResourcesClient) BeginDelete(ctx context.Context, sharedPrivateLinkResourceName string, resourceGroupName string, resourceName string, options *SharedPrivateLinkResourcesClientBeginDeleteOptions) (SharedPrivateLinkResourcesClientDeletePollerResponse, error) { resp, err := client.deleteOperation(ctx, sharedPrivateLinkResourceName, resourceGroupName, resourceName, options) if err != nil { - return SignalRSharedPrivateLinkResourcesDeletePollerResponse{}, err + return SharedPrivateLinkResourcesClientDeletePollerResponse{}, err } - result := SignalRSharedPrivateLinkResourcesDeletePollerResponse{ + result := SharedPrivateLinkResourcesClientDeletePollerResponse{ RawResponse: resp, } - pt, err := armruntime.NewPoller("SignalRSharedPrivateLinkResourcesClient.Delete", "", resp, client.pl, client.deleteHandleError) + pt, err := armruntime.NewPoller("SharedPrivateLinkResourcesClient.Delete", "", resp, client.pl) if err != nil { - return SignalRSharedPrivateLinkResourcesDeletePollerResponse{}, err + return SharedPrivateLinkResourcesClientDeletePollerResponse{}, err } - result.Poller = &SignalRSharedPrivateLinkResourcesDeletePoller{ + result.Poller = &SharedPrivateLinkResourcesClientDeletePoller{ pt: pt, } return result, nil } // Delete - Delete the specified shared private link resource -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRSharedPrivateLinkResourcesClient) deleteOperation(ctx context.Context, sharedPrivateLinkResourceName string, resourceGroupName string, resourceName string, options *SignalRSharedPrivateLinkResourcesBeginDeleteOptions) (*http.Response, error) { +// If the operation fails it returns an *azcore.ResponseError type. +func (client *SharedPrivateLinkResourcesClient) deleteOperation(ctx context.Context, sharedPrivateLinkResourceName string, resourceGroupName string, resourceName string, options *SharedPrivateLinkResourcesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, sharedPrivateLinkResourceName, resourceGroupName, resourceName, options) if err != nil { return nil, err @@ -154,13 +162,13 @@ func (client *SignalRSharedPrivateLinkResourcesClient) deleteOperation(ctx conte return nil, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, client.deleteHandleError(resp) + return nil, runtime.NewResponseError(resp) } return resp, nil } // deleteCreateRequest creates the Delete request. -func (client *SignalRSharedPrivateLinkResourcesClient) deleteCreateRequest(ctx context.Context, sharedPrivateLinkResourceName string, resourceGroupName string, resourceName string, options *SignalRSharedPrivateLinkResourcesBeginDeleteOptions) (*policy.Request, error) { +func (client *SharedPrivateLinkResourcesClient) deleteCreateRequest(ctx context.Context, sharedPrivateLinkResourceName string, resourceGroupName string, resourceName string, options *SharedPrivateLinkResourcesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}" if sharedPrivateLinkResourceName == "" { return nil, errors.New("parameter sharedPrivateLinkResourceName cannot be empty") @@ -178,7 +186,7 @@ func (client *SignalRSharedPrivateLinkResourcesClient) deleteCreateRequest(ctx c return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } @@ -189,38 +197,31 @@ func (client *SignalRSharedPrivateLinkResourcesClient) deleteCreateRequest(ctx c return req, nil } -// deleteHandleError handles the Delete error response. -func (client *SignalRSharedPrivateLinkResourcesClient) deleteHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := ErrorResponse{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Get - Get the specified shared private link resource -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRSharedPrivateLinkResourcesClient) Get(ctx context.Context, sharedPrivateLinkResourceName string, resourceGroupName string, resourceName string, options *SignalRSharedPrivateLinkResourcesGetOptions) (SignalRSharedPrivateLinkResourcesGetResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// sharedPrivateLinkResourceName - The name of the shared private link resource +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// resourceName - The name of the resource. +// options - SharedPrivateLinkResourcesClientGetOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.Get +// method. +func (client *SharedPrivateLinkResourcesClient) Get(ctx context.Context, sharedPrivateLinkResourceName string, resourceGroupName string, resourceName string, options *SharedPrivateLinkResourcesClientGetOptions) (SharedPrivateLinkResourcesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, sharedPrivateLinkResourceName, resourceGroupName, resourceName, options) if err != nil { - return SignalRSharedPrivateLinkResourcesGetResponse{}, err + return SharedPrivateLinkResourcesClientGetResponse{}, err } resp, err := client.pl.Do(req) if err != nil { - return SignalRSharedPrivateLinkResourcesGetResponse{}, err + return SharedPrivateLinkResourcesClientGetResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return SignalRSharedPrivateLinkResourcesGetResponse{}, client.getHandleError(resp) + return SharedPrivateLinkResourcesClientGetResponse{}, runtime.NewResponseError(resp) } return client.getHandleResponse(resp) } // getCreateRequest creates the Get request. -func (client *SignalRSharedPrivateLinkResourcesClient) getCreateRequest(ctx context.Context, sharedPrivateLinkResourceName string, resourceGroupName string, resourceName string, options *SignalRSharedPrivateLinkResourcesGetOptions) (*policy.Request, error) { +func (client *SharedPrivateLinkResourcesClient) getCreateRequest(ctx context.Context, sharedPrivateLinkResourceName string, resourceGroupName string, resourceName string, options *SharedPrivateLinkResourcesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}" if sharedPrivateLinkResourceName == "" { return nil, errors.New("parameter sharedPrivateLinkResourceName cannot be empty") @@ -238,7 +239,7 @@ func (client *SignalRSharedPrivateLinkResourcesClient) getCreateRequest(ctx cont return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } @@ -250,43 +251,35 @@ func (client *SignalRSharedPrivateLinkResourcesClient) getCreateRequest(ctx cont } // getHandleResponse handles the Get response. -func (client *SignalRSharedPrivateLinkResourcesClient) getHandleResponse(resp *http.Response) (SignalRSharedPrivateLinkResourcesGetResponse, error) { - result := SignalRSharedPrivateLinkResourcesGetResponse{RawResponse: resp} +func (client *SharedPrivateLinkResourcesClient) getHandleResponse(resp *http.Response) (SharedPrivateLinkResourcesClientGetResponse, error) { + result := SharedPrivateLinkResourcesClientGetResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.SharedPrivateLinkResource); err != nil { - return SignalRSharedPrivateLinkResourcesGetResponse{}, runtime.NewResponseError(err, resp) + return SharedPrivateLinkResourcesClientGetResponse{}, err } return result, nil } -// getHandleError handles the Get error response. -func (client *SignalRSharedPrivateLinkResourcesClient) getHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := ErrorResponse{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // List - List shared private link resources -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRSharedPrivateLinkResourcesClient) List(resourceGroupName string, resourceName string, options *SignalRSharedPrivateLinkResourcesListOptions) *SignalRSharedPrivateLinkResourcesListPager { - return &SignalRSharedPrivateLinkResourcesListPager{ +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// resourceName - The name of the resource. +// options - SharedPrivateLinkResourcesClientListOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.List +// method. +func (client *SharedPrivateLinkResourcesClient) List(resourceGroupName string, resourceName string, options *SharedPrivateLinkResourcesClientListOptions) *SharedPrivateLinkResourcesClientListPager { + return &SharedPrivateLinkResourcesClientListPager{ client: client, requester: func(ctx context.Context) (*policy.Request, error) { return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) }, - advancer: func(ctx context.Context, resp SignalRSharedPrivateLinkResourcesListResponse) (*policy.Request, error) { + advancer: func(ctx context.Context, resp SharedPrivateLinkResourcesClientListResponse) (*policy.Request, error) { return runtime.NewRequest(ctx, http.MethodGet, *resp.SharedPrivateLinkResourceList.NextLink) }, } } // listCreateRequest creates the List request. -func (client *SignalRSharedPrivateLinkResourcesClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *SignalRSharedPrivateLinkResourcesListOptions) (*policy.Request, error) { +func (client *SharedPrivateLinkResourcesClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *SharedPrivateLinkResourcesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/sharedPrivateLinkResources" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -300,7 +293,7 @@ func (client *SignalRSharedPrivateLinkResourcesClient) listCreateRequest(ctx con return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } @@ -312,23 +305,10 @@ func (client *SignalRSharedPrivateLinkResourcesClient) listCreateRequest(ctx con } // listHandleResponse handles the List response. -func (client *SignalRSharedPrivateLinkResourcesClient) listHandleResponse(resp *http.Response) (SignalRSharedPrivateLinkResourcesListResponse, error) { - result := SignalRSharedPrivateLinkResourcesListResponse{RawResponse: resp} +func (client *SharedPrivateLinkResourcesClient) listHandleResponse(resp *http.Response) (SharedPrivateLinkResourcesClientListResponse, error) { + result := SharedPrivateLinkResourcesClientListResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.SharedPrivateLinkResourceList); err != nil { - return SignalRSharedPrivateLinkResourcesListResponse{}, runtime.NewResponseError(err, resp) + return SharedPrivateLinkResourcesClientListResponse{}, err } return result, nil } - -// listHandleError handles the List error response. -func (client *SignalRSharedPrivateLinkResourcesClient) listHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := ErrorResponse{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} diff --git a/sdk/resourcemanager/signalr/armsignalr/zz_generated_signalrprivatelinkresources_client.go b/sdk/resourcemanager/signalr/armsignalr/zz_generated_signalrprivatelinkresources_client.go deleted file mode 100644 index 601b009a557d..000000000000 --- a/sdk/resourcemanager/signalr/armsignalr/zz_generated_signalrprivatelinkresources_client.go +++ /dev/null @@ -1,105 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsignalr - -import ( - "context" - "errors" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// SignalRPrivateLinkResourcesClient contains the methods for the SignalRPrivateLinkResources group. -// Don't use this type directly, use NewSignalRPrivateLinkResourcesClient() instead. -type SignalRPrivateLinkResourcesClient struct { - ep string - pl runtime.Pipeline - subscriptionID string -} - -// NewSignalRPrivateLinkResourcesClient creates a new instance of SignalRPrivateLinkResourcesClient with the specified values. -func NewSignalRPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *SignalRPrivateLinkResourcesClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options - } - if len(cp.Host) == 0 { - cp.Host = arm.AzurePublicCloud - } - return &SignalRPrivateLinkResourcesClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} -} - -// List - Get the private link resources that need to be created for a resource. -// If the operation fails it returns the *ErrorResponse error type. -func (client *SignalRPrivateLinkResourcesClient) List(resourceGroupName string, resourceName string, options *SignalRPrivateLinkResourcesListOptions) *SignalRPrivateLinkResourcesListPager { - return &SignalRPrivateLinkResourcesListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) - }, - advancer: func(ctx context.Context, resp SignalRPrivateLinkResourcesListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.PrivateLinkResourceList.NextLink) - }, - } -} - -// listCreateRequest creates the List request. -func (client *SignalRPrivateLinkResourcesClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *SignalRPrivateLinkResourcesListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/privateLinkResources" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") - return req, nil -} - -// listHandleResponse handles the List response. -func (client *SignalRPrivateLinkResourcesClient) listHandleResponse(resp *http.Response) (SignalRPrivateLinkResourcesListResponse, error) { - result := SignalRPrivateLinkResourcesListResponse{RawResponse: resp} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourceList); err != nil { - return SignalRPrivateLinkResourcesListResponse{}, runtime.NewResponseError(err, resp) - } - return result, nil -} - -// listHandleError handles the List error response. -func (client *SignalRPrivateLinkResourcesClient) listHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := ErrorResponse{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} diff --git a/sdk/resourcemanager/signalr/armsignalr/zz_generated_usages_client.go b/sdk/resourcemanager/signalr/armsignalr/zz_generated_usages_client.go index 2ea7d3920d59..addf82b5f0b8 100644 --- a/sdk/resourcemanager/signalr/armsignalr/zz_generated_usages_client.go +++ b/sdk/resourcemanager/signalr/armsignalr/zz_generated_usages_client.go @@ -11,7 +11,6 @@ package armsignalr import ( "context" "errors" - "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" @@ -25,39 +24,50 @@ import ( // UsagesClient contains the methods for the Usages group. // Don't use this type directly, use NewUsagesClient() instead. type UsagesClient struct { - ep string - pl runtime.Pipeline + host string subscriptionID string + pl runtime.Pipeline } // NewUsagesClient creates a new instance of UsagesClient with the specified values. +// subscriptionID - Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *UsagesClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Host) == 0 { - cp.Host = arm.AzurePublicCloud + ep := options.Endpoint + if len(ep) == 0 { + ep = arm.AzurePublicCloud } - return &UsagesClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} + client := &UsagesClient{ + subscriptionID: subscriptionID, + host: string(ep), + pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + } + return client } // List - List resource usage quotas by location. -// If the operation fails it returns the *ErrorResponse error type. -func (client *UsagesClient) List(location string, options *UsagesListOptions) *UsagesListPager { - return &UsagesListPager{ +// If the operation fails it returns an *azcore.ResponseError type. +// location - the location like "eastus" +// options - UsagesClientListOptions contains the optional parameters for the UsagesClient.List method. +func (client *UsagesClient) List(location string, options *UsagesClientListOptions) *UsagesClientListPager { + return &UsagesClientListPager{ client: client, requester: func(ctx context.Context) (*policy.Request, error) { return client.listCreateRequest(ctx, location, options) }, - advancer: func(ctx context.Context, resp UsagesListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.SignalRUsageList.NextLink) + advancer: func(ctx context.Context, resp UsagesClientListResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.UsageList.NextLink) }, } } // listCreateRequest creates the List request. -func (client *UsagesClient) listCreateRequest(ctx context.Context, location string, options *UsagesListOptions) (*policy.Request, error) { +func (client *UsagesClient) listCreateRequest(ctx context.Context, location string, options *UsagesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/locations/{location}/usages" if location == "" { return nil, errors.New("parameter location cannot be empty") @@ -67,7 +77,7 @@ func (client *UsagesClient) listCreateRequest(ctx context.Context, location stri return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } @@ -79,23 +89,10 @@ func (client *UsagesClient) listCreateRequest(ctx context.Context, location stri } // listHandleResponse handles the List response. -func (client *UsagesClient) listHandleResponse(resp *http.Response) (UsagesListResponse, error) { - result := UsagesListResponse{RawResponse: resp} - if err := runtime.UnmarshalAsJSON(resp, &result.SignalRUsageList); err != nil { - return UsagesListResponse{}, runtime.NewResponseError(err, resp) +func (client *UsagesClient) listHandleResponse(resp *http.Response) (UsagesClientListResponse, error) { + result := UsagesClientListResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.UsageList); err != nil { + return UsagesClientListResponse{}, err } return result, nil } - -// listHandleError handles the List error response. -func (client *UsagesClient) listHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := ErrorResponse{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -}