diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/CHANGELOG.md b/sdk/resourcemanager/recoveryservices/armrecoveryservices/CHANGELOG.md index b1b9b9b776dc..01b861d0eab0 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/CHANGELOG.md +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/CHANGELOG.md @@ -1,5 +1,31 @@ # Release History +## 2.0.0 (2023-01-23) +### Breaking Changes + +- Type of `ErrorAdditionalInfo.Info` has been changed from `interface{}` to `any` +- Struct `CloudError` has been removed + +### Features Added + +- New type alias `ImmutabilityState` with values `ImmutabilityStateDisabled`, `ImmutabilityStateLocked`, `ImmutabilityStateUnlocked` +- New type alias `PublicNetworkAccess` with values `PublicNetworkAccessDisabled`, `PublicNetworkAccessEnabled` +- New type alias `VaultSubResourceType` with values `VaultSubResourceTypeAzureBackup`, `VaultSubResourceTypeAzureBackupSecondary`, `VaultSubResourceTypeAzureSiteRecovery` +- New function `*Client.Capabilities(context.Context, string, ResourceCapabilities, *ClientCapabilitiesOptions) (ClientCapabilitiesResponse, error)` +- New struct `CapabilitiesProperties` +- New struct `CapabilitiesResponse` +- New struct `CapabilitiesResponseProperties` +- New struct `DNSZone` +- New struct `DNSZoneResponse` +- New struct `ImmutabilitySettings` +- New struct `ResourceCapabilities` +- New struct `ResourceCapabilitiesBase` +- New struct `SecuritySettings` +- New field `GroupIDs` in struct `PrivateEndpointConnection` +- New field `PublicNetworkAccess` in struct `VaultProperties` +- New field `SecuritySettings` in struct `VaultProperties` + + ## 1.1.0 (2022-07-22) ### Features Added diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/autorest.md b/sdk/resourcemanager/recoveryservices/armrecoveryservices/autorest.md index 7f0818fef167..52eefb4f77ac 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/autorest.md +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/autorest.md @@ -5,10 +5,10 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/43ca5ba8c01eafc595f418a66adb6c3c09d9b965/specification/recoveryservices/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/43ca5ba8c01eafc595f418a66adb6c3c09d9b965/specification/recoveryservices/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/recoveryservices/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/recoveryservices/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.0 +module-version: 2.0.0 directive: - from: vaults.json where: '$.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/operationStatus/{operationId}"].get' diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/client.go index 11245cbb41a7..4affc9b49e6d 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/client.go @@ -32,9 +32,9 @@ type Client struct { } // NewClient creates a new instance of Client with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - 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, error) { if options == nil { options = &arm.ClientOptions{} @@ -55,15 +55,69 @@ func NewClient(subscriptionID string, credential azcore.TokenCredential, options return client, nil } +// Capabilities - API to get details about capabilities provided by Microsoft.RecoveryServices RP +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01 +// - location - Location of the resource +// - input - Contains information about Resource type and properties to get capabilities +// - options - ClientCapabilitiesOptions contains the optional parameters for the Client.Capabilities method. +func (client *Client) Capabilities(ctx context.Context, location string, input ResourceCapabilities, options *ClientCapabilitiesOptions) (ClientCapabilitiesResponse, error) { + req, err := client.capabilitiesCreateRequest(ctx, location, input, options) + if err != nil { + return ClientCapabilitiesResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ClientCapabilitiesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ClientCapabilitiesResponse{}, runtime.NewResponseError(resp) + } + return client.capabilitiesHandleResponse(resp) +} + +// capabilitiesCreateRequest creates the Capabilities request. +func (client *Client) capabilitiesCreateRequest(ctx context.Context, location string, input ResourceCapabilities, options *ClientCapabilitiesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{location}/capabilities" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, input) +} + +// capabilitiesHandleResponse handles the Capabilities response. +func (client *Client) capabilitiesHandleResponse(resp *http.Response) (ClientCapabilitiesResponse, error) { + result := ClientCapabilitiesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CapabilitiesResponse); err != nil { + return ClientCapabilitiesResponse{}, err + } + return result, nil +} + // CheckNameAvailability - API to check for resource name availability. A name is available if no other resource exists that // has the same SubscriptionId, Resource Name and Type or if one or more such resources exist, each of // these must be GC'd and their time of deletion be more than 24 Hours Ago // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// location - Location of the resource -// input - Contains information about Resource type and Resource name -// options - ClientCheckNameAvailabilityOptions contains the optional parameters for the Client.CheckNameAvailability method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - location - Location of the resource +// - input - Contains information about Resource type and Resource name +// - options - ClientCheckNameAvailabilityOptions contains the optional parameters for the Client.CheckNameAvailability method. func (client *Client) CheckNameAvailability(ctx context.Context, resourceGroupName string, location string, input CheckNameAvailabilityParameters, options *ClientCheckNameAvailabilityOptions) (ClientCheckNameAvailabilityResponse, error) { req, err := client.checkNameAvailabilityCreateRequest(ctx, resourceGroupName, location, input, options) if err != nil { @@ -99,7 +153,7 @@ func (client *Client) checkNameAvailabilityCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, input) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/constants.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/constants.go index 33ee98a9eeff..d8b8796c6562 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/constants.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/constants.go @@ -11,7 +11,7 @@ package armrecoveryservices const ( moduleName = "armrecoveryservices" - moduleVersion = "v1.1.0" + moduleVersion = "v2.0.0" ) type AlertsState string @@ -105,6 +105,23 @@ func PossibleCrossRegionRestoreValues() []CrossRegionRestore { } } +type ImmutabilityState string + +const ( + ImmutabilityStateDisabled ImmutabilityState = "Disabled" + ImmutabilityStateLocked ImmutabilityState = "Locked" + ImmutabilityStateUnlocked ImmutabilityState = "Unlocked" +) + +// PossibleImmutabilityStateValues returns the possible values for the ImmutabilityState const type. +func PossibleImmutabilityStateValues() []ImmutabilityState { + return []ImmutabilityState{ + ImmutabilityStateDisabled, + ImmutabilityStateLocked, + ImmutabilityStateUnlocked, + } +} + // InfrastructureEncryptionState - Enabling/Disabling the Double Encryption state type InfrastructureEncryptionState string @@ -161,6 +178,22 @@ func PossibleProvisioningStateValues() []ProvisioningState { } } +// PublicNetworkAccess - property to enable or disable resource provider inbound network traffic from public clients +type PublicNetworkAccess string + +const ( + PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" +) + +// PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type. +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return []PublicNetworkAccess{ + PublicNetworkAccessDisabled, + PublicNetworkAccessEnabled, + } +} + // ResourceIdentityType - The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly // created identity and a set of user-assigned identities. The type 'None' will remove any // identities. @@ -307,6 +340,24 @@ func PossibleVaultPrivateEndpointStateValues() []VaultPrivateEndpointState { } } +// VaultSubResourceType - Subresource type for vault AzureBackup, AzureBackup_secondary or AzureSiteRecovery +type VaultSubResourceType string + +const ( + VaultSubResourceTypeAzureBackup VaultSubResourceType = "AzureBackup" + VaultSubResourceTypeAzureBackupSecondary VaultSubResourceType = "AzureBackup_secondary" + VaultSubResourceTypeAzureSiteRecovery VaultSubResourceType = "AzureSiteRecovery" +) + +// PossibleVaultSubResourceTypeValues returns the possible values for the VaultSubResourceType const type. +func PossibleVaultSubResourceTypeValues() []VaultSubResourceType { + return []VaultSubResourceType{ + VaultSubResourceTypeAzureBackup, + VaultSubResourceTypeAzureBackupSecondary, + VaultSubResourceTypeAzureSiteRecovery, + } +} + // VaultUpgradeState - Status of the vault upgrade operation. type VaultUpgradeState string diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/go.mod b/sdk/resourcemanager/recoveryservices/armrecoveryservices/go.mod index 99a69ab79f6c..c20d99f6eb3f 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/go.mod +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/go.mod @@ -1,21 +1,13 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservices +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservices/v2 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/go.sum b/sdk/resourcemanager/recoveryservices/armrecoveryservices/go.sum index 8828b17b1853..3afb578030a5 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/go.sum +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 h1:BWe8a+f/t+7KY7zH2mqygeUD0t8hNFXe08p1Pb3/jKE= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt 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/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -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/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/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/models.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/models.go index 6511a16f82be..3862ba574fdb 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/models.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/models.go @@ -16,6 +16,25 @@ type AzureMonitorAlertSettings struct { AlertsForAllJobFailures *AlertsState `json:"alertsForAllJobFailures,omitempty"` } +// CapabilitiesProperties - Capabilities information +type CapabilitiesProperties struct { + DNSZones []*DNSZone `json:"dnsZones,omitempty"` +} + +// CapabilitiesResponse - Capabilities response for Microsoft.RecoveryServices +type CapabilitiesResponse struct { + // REQUIRED; Describes the Resource type: Microsoft.RecoveryServices/Vaults + Type *string `json:"type,omitempty"` + + // Capabilities properties in response + Properties *CapabilitiesResponseProperties `json:"properties,omitempty"` +} + +// CapabilitiesResponseProperties - Capabilities properties in response +type CapabilitiesResponseProperties struct { + DNSZones []*DNSZoneResponse `json:"dnsZones,omitempty"` +} + // CertificateRequest - Details of the certificate to be uploaded to the vault. type CertificateRequest struct { // Raw certificate data. @@ -44,6 +63,11 @@ type ClassicAlertSettings struct { AlertsForCriticalOperations *AlertsState `json:"alertsForCriticalOperations,omitempty"` } +// ClientCapabilitiesOptions contains the optional parameters for the Client.Capabilities method. +type ClientCapabilitiesOptions struct { + // placeholder for future optional parameters +} + // ClientCheckNameAvailabilityOptions contains the optional parameters for the Client.CheckNameAvailability method. type ClientCheckNameAvailabilityOptions struct { // placeholder for future optional parameters @@ -112,12 +136,6 @@ type ClientDiscoveryValueForSingleAPI struct { Properties *ClientDiscoveryForProperties `json:"properties,omitempty"` } -// CloudError - An error response from Azure Backup. -type CloudError struct { - // The resource management error response. - Error *Error `json:"error,omitempty"` -} - // CmkKekIdentity - The details of the identity used for CMK type CmkKekIdentity struct { // Indicate that system assigned identity should be used. Mutually exclusive with 'userAssignedIdentity' field @@ -133,6 +151,21 @@ type CmkKeyVaultProperties struct { KeyURI *string `json:"keyUri,omitempty"` } +// DNSZone information +type DNSZone struct { + // Subresource type for vault AzureBackup, AzureBackup_secondary or AzureSiteRecovery + SubResource *VaultSubResourceType `json:"subResource,omitempty"` +} + +// DNSZoneResponse - DNSZone information for Microsoft.RecoveryServices +type DNSZoneResponse struct { + // The private link resource Private link DNS zone names. + RequiredZoneNames []*string `json:"requiredZoneNames,omitempty"` + + // Subresource type for vault AzureBackup, AzureBackup_secondary or AzureSiteRecovery + SubResource *VaultSubResourceType `json:"subResource,omitempty"` +} + // Error - The resource management error response. type Error struct { // READ-ONLY; The error additional info. @@ -154,7 +187,7 @@ type Error struct { // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. - Info interface{} `json:"info,omitempty" azure:"ro"` + Info any `json:"info,omitempty" azure:"ro"` // READ-ONLY; The additional info type. Type *string `json:"type,omitempty" azure:"ro"` @@ -179,6 +212,11 @@ type IdentityData struct { TenantID *string `json:"tenantId,omitempty" azure:"ro"` } +// ImmutabilitySettings - Immutability Settings of vault +type ImmutabilitySettings struct { + State *ImmutabilityState `json:"state,omitempty"` +} + // JobsSummary - Summary of the replication job data for this vault. type JobsSummary struct { // Count of failed jobs. @@ -258,7 +296,7 @@ type OperationsClientGetOperationResultOptions struct { // placeholder for future optional parameters } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters } @@ -328,6 +366,9 @@ type PrivateEndpoint struct { // PrivateEndpointConnection - Private Endpoint Connection Response Properties. type PrivateEndpointConnection struct { + // Group Ids for the Private Endpoint + GroupIDs []*VaultSubResourceType `json:"groupIds,omitempty"` + // READ-ONLY; The Private Endpoint network resource that is linked to the Private Endpoint connection. PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty" azure:"ro"` @@ -398,7 +439,8 @@ type PrivateLinkResourcesClientGetOptions struct { // placeholder for future optional parameters } -// PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.List method. +// PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListPager +// method. type PrivateLinkResourcesClientListOptions struct { // placeholder for future optional parameters } @@ -456,7 +498,7 @@ type ReplicationUsageList struct { Value []*ReplicationUsage `json:"value,omitempty"` } -// ReplicationUsagesClientListOptions contains the optional parameters for the ReplicationUsagesClient.List method. +// ReplicationUsagesClientListOptions contains the optional parameters for the ReplicationUsagesClient.NewListPager method. type ReplicationUsagesClientListOptions struct { // placeholder for future optional parameters } @@ -476,6 +518,21 @@ type Resource struct { Type *string `json:"type,omitempty" azure:"ro"` } +// ResourceCapabilities - Input to get capabilities information for Microsoft.RecoveryServices +type ResourceCapabilities struct { + // REQUIRED; Describes the Resource type: Microsoft.RecoveryServices/Vaults + Type *string `json:"type,omitempty"` + + // Capabilities information + Properties *CapabilitiesProperties `json:"properties,omitempty"` +} + +// ResourceCapabilitiesBase - Base class for request and response capabilities information for Microsoft.RecoveryServices +type ResourceCapabilitiesBase struct { + // REQUIRED; Describes the Resource type: Microsoft.RecoveryServices/Vaults + Type *string `json:"type,omitempty"` +} + // ResourceCertificateAndAADDetails - Certificate details representing the Vault credentials for AAD. type ResourceCertificateAndAADDetails struct { // REQUIRED; AAD tenant authority. @@ -660,6 +717,12 @@ type SKU struct { Tier *string `json:"tier,omitempty"` } +// SecuritySettings - Security Settings of the vault +type SecuritySettings struct { + // Immutability Settings of a vault + ImmutabilitySettings *ImmutabilitySettings `json:"immutabilitySettings,omitempty"` +} + // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). @@ -732,7 +795,7 @@ type UpgradeDetails struct { UpgradedResourceID *string `json:"upgradedResourceId,omitempty" azure:"ro"` } -// UsagesClientListByVaultsOptions contains the optional parameters for the UsagesClient.ListByVaults method. +// UsagesClientListByVaultsOptions contains the optional parameters for the UsagesClient.NewListByVaultsPager method. type UsagesClientListByVaultsOptions struct { // placeholder for future optional parameters } @@ -868,9 +931,15 @@ type VaultProperties struct { // The details of the latest move operation performed on the Azure Resource MoveDetails *VaultPropertiesMoveDetails `json:"moveDetails,omitempty"` + // property to enable or disable resource provider inbound network traffic from public clients + PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // The redundancy Settings of a Vault RedundancySettings *VaultPropertiesRedundancySettings `json:"redundancySettings,omitempty"` + // Security Settings of the vault + SecuritySettings *SecuritySettings `json:"securitySettings,omitempty"` + // Details for upgrading vault. UpgradeDetails *UpgradeDetails `json:"upgradeDetails,omitempty"` @@ -981,12 +1050,14 @@ type VaultsClientGetOptions struct { // placeholder for future optional parameters } -// VaultsClientListByResourceGroupOptions contains the optional parameters for the VaultsClient.ListByResourceGroup method. +// VaultsClientListByResourceGroupOptions contains the optional parameters for the VaultsClient.NewListByResourceGroupPager +// method. type VaultsClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// VaultsClientListBySubscriptionIDOptions contains the optional parameters for the VaultsClient.ListBySubscriptionID method. +// VaultsClientListBySubscriptionIDOptions contains the optional parameters for the VaultsClient.NewListBySubscriptionIDPager +// method. type VaultsClientListBySubscriptionIDOptions struct { // placeholder for future optional parameters } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/models_serde.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/models_serde.go index 17510126ce84..e8dbce81ef6c 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/models_serde.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/models_serde.go @@ -19,7 +19,7 @@ import ( // MarshalJSON implements the json.Marshaller interface for type AzureMonitorAlertSettings. func (a AzureMonitorAlertSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "alertsForAllJobFailures", a.AlertsForAllJobFailures) return json.Marshal(objectMap) } @@ -44,9 +44,94 @@ func (a *AzureMonitorAlertSettings) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type CapabilitiesProperties. +func (c CapabilitiesProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dnsZones", c.DNSZones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CapabilitiesProperties. +func (c *CapabilitiesProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dnsZones": + err = unpopulate(val, "DNSZones", &c.DNSZones) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CapabilitiesResponse. +func (c CapabilitiesResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CapabilitiesResponse. +func (c *CapabilitiesResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CapabilitiesResponseProperties. +func (c CapabilitiesResponseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dnsZones", c.DNSZones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CapabilitiesResponseProperties. +func (c *CapabilitiesResponseProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dnsZones": + err = unpopulate(val, "DNSZones", &c.DNSZones) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type CertificateRequest. func (c CertificateRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "properties", c.Properties) return json.Marshal(objectMap) } @@ -73,7 +158,7 @@ func (c *CertificateRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityParameters. func (c CheckNameAvailabilityParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", c.Name) populate(objectMap, "type", c.Type) return json.Marshal(objectMap) @@ -104,7 +189,7 @@ func (c *CheckNameAvailabilityParameters) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityResult. func (c CheckNameAvailabilityResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "message", c.Message) populate(objectMap, "nameAvailable", c.NameAvailable) populate(objectMap, "reason", c.Reason) @@ -139,7 +224,7 @@ func (c *CheckNameAvailabilityResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ClassicAlertSettings. func (c ClassicAlertSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "alertsForCriticalOperations", c.AlertsForCriticalOperations) return json.Marshal(objectMap) } @@ -166,7 +251,7 @@ func (c *ClassicAlertSettings) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ClientDiscoveryDisplay. func (c ClientDiscoveryDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", c.Description) populate(objectMap, "operation", c.Operation) populate(objectMap, "provider", c.Provider) @@ -205,7 +290,7 @@ func (c *ClientDiscoveryDisplay) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ClientDiscoveryForLogSpecification. func (c ClientDiscoveryForLogSpecification) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "blobDuration", c.BlobDuration) populate(objectMap, "displayName", c.DisplayName) populate(objectMap, "name", c.Name) @@ -240,7 +325,7 @@ func (c *ClientDiscoveryForLogSpecification) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ClientDiscoveryForProperties. func (c ClientDiscoveryForProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "serviceSpecification", c.ServiceSpecification) return json.Marshal(objectMap) } @@ -267,7 +352,7 @@ func (c *ClientDiscoveryForProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ClientDiscoveryForServiceSpecification. func (c ClientDiscoveryForServiceSpecification) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "logSpecifications", c.LogSpecifications) return json.Marshal(objectMap) } @@ -294,7 +379,7 @@ func (c *ClientDiscoveryForServiceSpecification) UnmarshalJSON(data []byte) erro // MarshalJSON implements the json.Marshaller interface for type ClientDiscoveryResponse. func (c ClientDiscoveryResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", c.NextLink) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) @@ -325,7 +410,7 @@ func (c *ClientDiscoveryResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ClientDiscoveryValueForSingleAPI. func (c ClientDiscoveryValueForSingleAPI) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "display", c.Display) populate(objectMap, "name", c.Name) populate(objectMap, "origin", c.Origin) @@ -362,36 +447,9 @@ func (c *ClientDiscoveryValueForSingleAPI) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CloudError. -func (c CloudError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "error", c.Error) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudError. -func (c *CloudError) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "error": - err = unpopulate(val, "Error", &c.Error) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type CmkKekIdentity. func (c CmkKekIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "useSystemAssignedIdentity", c.UseSystemAssignedIdentity) populate(objectMap, "userAssignedIdentity", c.UserAssignedIdentity) return json.Marshal(objectMap) @@ -422,7 +480,7 @@ func (c *CmkKekIdentity) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CmkKeyVaultProperties. func (c CmkKeyVaultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "keyUri", c.KeyURI) return json.Marshal(objectMap) } @@ -447,9 +505,67 @@ func (c *CmkKeyVaultProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DNSZone. +func (d DNSZone) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "subResource", d.SubResource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DNSZone. +func (d *DNSZone) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "subResource": + err = unpopulate(val, "SubResource", &d.SubResource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DNSZoneResponse. +func (d DNSZoneResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "requiredZoneNames", d.RequiredZoneNames) + populate(objectMap, "subResource", d.SubResource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DNSZoneResponse. +func (d *DNSZoneResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &d.RequiredZoneNames) + delete(rawMsg, key) + case "subResource": + err = unpopulate(val, "SubResource", &d.SubResource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Error. func (e Error) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "additionalInfo", e.AdditionalInfo) populate(objectMap, "code", e.Code) populate(objectMap, "details", e.Details) @@ -492,7 +608,7 @@ func (e *Error) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "info", &e.Info) populate(objectMap, "type", e.Type) return json.Marshal(objectMap) @@ -523,7 +639,7 @@ func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IdentityData. func (i IdentityData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "principalId", i.PrincipalID) populate(objectMap, "tenantId", i.TenantID) populate(objectMap, "type", i.Type) @@ -560,9 +676,36 @@ func (i *IdentityData) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ImmutabilitySettings. +func (i ImmutabilitySettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "state", i.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImmutabilitySettings. +func (i *ImmutabilitySettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "state": + err = unpopulate(val, "State", &i.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type JobsSummary. func (j JobsSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "failedJobs", j.FailedJobs) populate(objectMap, "inProgressJobs", j.InProgressJobs) populate(objectMap, "suspendedJobs", j.SuspendedJobs) @@ -597,7 +740,7 @@ func (j *JobsSummary) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MonitoringSettings. func (m MonitoringSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "azureMonitorAlertSettings", m.AzureMonitorAlertSettings) populate(objectMap, "classicAlertSettings", m.ClassicAlertSettings) return json.Marshal(objectMap) @@ -628,7 +771,7 @@ func (m *MonitoringSettings) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MonitoringSummary. func (m MonitoringSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "deprecatedProviderCount", m.DeprecatedProviderCount) populate(objectMap, "eventsCount", m.EventsCount) populate(objectMap, "supportedProviderCount", m.SupportedProviderCount) @@ -675,7 +818,7 @@ func (m *MonitoringSummary) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type NameInfo. func (n NameInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "localizedValue", n.LocalizedValue) populate(objectMap, "value", n.Value) return json.Marshal(objectMap) @@ -706,7 +849,7 @@ func (n *NameInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationResource. func (o OperationResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "endTime", o.EndTime) populate(objectMap, "error", o.Error) populate(objectMap, "id", o.ID) @@ -753,7 +896,7 @@ func (o *OperationResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PatchTrackedResource. func (p PatchTrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "etag", p.Etag) populate(objectMap, "id", p.ID) populate(objectMap, "location", p.Location) @@ -800,7 +943,7 @@ func (p *PatchTrackedResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PatchVault. func (p PatchVault) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "etag", p.Etag) populate(objectMap, "id", p.ID) populate(objectMap, "identity", p.Identity) @@ -859,7 +1002,7 @@ func (p *PatchVault) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint. func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", p.ID) return json.Marshal(objectMap) } @@ -886,7 +1029,8 @@ func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) + populate(objectMap, "groupIds", p.GroupIDs) populate(objectMap, "privateEndpoint", p.PrivateEndpoint) populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) populate(objectMap, "provisioningState", p.ProvisioningState) @@ -902,6 +1046,9 @@ func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "groupIds": + err = unpopulate(val, "GroupIDs", &p.GroupIDs) + delete(rawMsg, key) case "privateEndpoint": err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) delete(rawMsg, key) @@ -921,7 +1068,7 @@ func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionVaultProperties. func (p PrivateEndpointConnectionVaultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "location", p.Location) populate(objectMap, "name", p.Name) @@ -964,7 +1111,7 @@ func (p *PrivateEndpointConnectionVaultProperties) UnmarshalJSON(data []byte) er // MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) @@ -1003,7 +1150,7 @@ func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "groupId", p.GroupID) populate(objectMap, "requiredMembers", p.RequiredMembers) populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) @@ -1038,7 +1185,7 @@ func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateLinkResources. func (p PrivateLinkResources) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", p.NextLink) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) @@ -1069,7 +1216,7 @@ func (p *PrivateLinkResources) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState. func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "actionsRequired", p.ActionsRequired) populate(objectMap, "description", p.Description) populate(objectMap, "status", p.Status) @@ -1104,7 +1251,7 @@ func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RawCertificateData. func (r RawCertificateData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "authType", r.AuthType) populateByteArray(objectMap, "certificate", r.Certificate, runtime.Base64StdFormat) return json.Marshal(objectMap) @@ -1135,7 +1282,7 @@ func (r *RawCertificateData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ReplicationUsage. func (r ReplicationUsage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "jobsSummary", r.JobsSummary) populate(objectMap, "monitoringSummary", r.MonitoringSummary) populate(objectMap, "protectedItemCount", r.ProtectedItemCount) @@ -1182,7 +1329,7 @@ func (r *ReplicationUsage) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ReplicationUsageList. func (r ReplicationUsageList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } @@ -1209,7 +1356,7 @@ func (r *ReplicationUsageList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Resource. func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "etag", r.Etag) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) @@ -1246,9 +1393,67 @@ func (r *Resource) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ResourceCapabilities. +func (r ResourceCapabilities) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceCapabilities. +func (r *ResourceCapabilities) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceCapabilitiesBase. +func (r ResourceCapabilitiesBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceCapabilitiesBase. +func (r *ResourceCapabilitiesBase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ResourceCertificateAndAADDetails. func (r ResourceCertificateAndAADDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "aadAudience", r.AADAudience) populate(objectMap, "aadAuthority", r.AADAuthority) populate(objectMap, "aadTenantId", r.AADTenantID) @@ -1335,7 +1540,7 @@ func (r *ResourceCertificateAndAADDetails) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ResourceCertificateAndAcsDetails. func (r ResourceCertificateAndAcsDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["authType"] = "AccessControlService" populateByteArray(objectMap, "certificate", r.Certificate, runtime.Base64StdFormat) populate(objectMap, "friendlyName", r.FriendlyName) @@ -1406,7 +1611,7 @@ func (r *ResourceCertificateAndAcsDetails) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ResourceCertificateDetails. func (r ResourceCertificateDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["authType"] = r.AuthType populateByteArray(objectMap, "certificate", r.Certificate, runtime.Base64StdFormat) populate(objectMap, "friendlyName", r.FriendlyName) @@ -1465,7 +1670,7 @@ func (r *ResourceCertificateDetails) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SKU. func (s SKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "capacity", s.Capacity) populate(objectMap, "family", s.Family) populate(objectMap, "name", s.Name) @@ -1506,9 +1711,36 @@ func (s *SKU) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SecuritySettings. +func (s SecuritySettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "immutabilitySettings", s.ImmutabilitySettings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecuritySettings. +func (s *SecuritySettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "immutabilitySettings": + err = unpopulate(val, "ImmutabilitySettings", &s.ImmutabilitySettings) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) @@ -1555,7 +1787,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "etag", t.Etag) populate(objectMap, "id", t.ID) populate(objectMap, "location", t.Location) @@ -1602,7 +1834,7 @@ func (t *TrackedResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type UpgradeDetails. func (u UpgradeDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "endTimeUtc", u.EndTimeUTC) populateTimeRFC3339(objectMap, "lastUpdatedTimeUtc", u.LastUpdatedTimeUTC) populate(objectMap, "message", u.Message) @@ -1661,7 +1893,7 @@ func (u *UpgradeDetails) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type UserIdentity. func (u UserIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "clientId", u.ClientID) populate(objectMap, "principalId", u.PrincipalID) return json.Marshal(objectMap) @@ -1692,7 +1924,7 @@ func (u *UserIdentity) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Vault. func (v Vault) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "etag", v.Etag) populate(objectMap, "id", v.ID) populate(objectMap, "identity", v.Identity) @@ -1755,7 +1987,7 @@ func (v *Vault) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VaultCertificateResponse. func (v VaultCertificateResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", v.ID) populate(objectMap, "name", v.Name) populate(objectMap, "properties", v.Properties) @@ -1794,7 +2026,7 @@ func (v *VaultCertificateResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VaultExtendedInfo. func (v VaultExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "algorithm", v.Algorithm) populate(objectMap, "encryptionKey", v.EncryptionKey) populate(objectMap, "encryptionKeyThumbprint", v.EncryptionKeyThumbprint) @@ -1833,7 +2065,7 @@ func (v *VaultExtendedInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VaultExtendedInfoResource. func (v VaultExtendedInfoResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "etag", v.Etag) populate(objectMap, "id", v.ID) populate(objectMap, "name", v.Name) @@ -1876,7 +2108,7 @@ func (v *VaultExtendedInfoResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VaultList. func (v VaultList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", v.NextLink) populate(objectMap, "value", v.Value) return json.Marshal(objectMap) @@ -1907,7 +2139,7 @@ func (v *VaultList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VaultProperties. func (v VaultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupStorageVersion", v.BackupStorageVersion) populate(objectMap, "encryption", v.Encryption) populate(objectMap, "monitoringSettings", v.MonitoringSettings) @@ -1917,7 +2149,9 @@ func (v VaultProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "privateEndpointStateForBackup", v.PrivateEndpointStateForBackup) populate(objectMap, "privateEndpointStateForSiteRecovery", v.PrivateEndpointStateForSiteRecovery) populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "publicNetworkAccess", v.PublicNetworkAccess) populate(objectMap, "redundancySettings", v.RedundancySettings) + populate(objectMap, "securitySettings", v.SecuritySettings) populate(objectMap, "upgradeDetails", v.UpgradeDetails) return json.Marshal(objectMap) } @@ -1958,9 +2192,15 @@ func (v *VaultProperties) UnmarshalJSON(data []byte) error { case "provisioningState": err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &v.PublicNetworkAccess) + delete(rawMsg, key) case "redundancySettings": err = unpopulate(val, "RedundancySettings", &v.RedundancySettings) delete(rawMsg, key) + case "securitySettings": + err = unpopulate(val, "SecuritySettings", &v.SecuritySettings) + delete(rawMsg, key) case "upgradeDetails": err = unpopulate(val, "UpgradeDetails", &v.UpgradeDetails) delete(rawMsg, key) @@ -1974,7 +2214,7 @@ func (v *VaultProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VaultPropertiesEncryption. func (v VaultPropertiesEncryption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "infrastructureEncryption", v.InfrastructureEncryption) populate(objectMap, "kekIdentity", v.KekIdentity) populate(objectMap, "keyVaultProperties", v.KeyVaultProperties) @@ -2009,7 +2249,7 @@ func (v *VaultPropertiesEncryption) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VaultPropertiesMoveDetails. func (v VaultPropertiesMoveDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "completionTimeUtc", v.CompletionTimeUTC) populate(objectMap, "operationId", v.OperationID) populate(objectMap, "sourceResourceId", v.SourceResourceID) @@ -2052,7 +2292,7 @@ func (v *VaultPropertiesMoveDetails) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VaultPropertiesRedundancySettings. func (v VaultPropertiesRedundancySettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "crossRegionRestore", v.CrossRegionRestore) populate(objectMap, "standardTierStorageRedundancy", v.StandardTierStorageRedundancy) return json.Marshal(objectMap) @@ -2083,7 +2323,7 @@ func (v *VaultPropertiesRedundancySettings) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VaultUsage. func (v VaultUsage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "currentValue", v.CurrentValue) populate(objectMap, "limit", v.Limit) populate(objectMap, "name", v.Name) @@ -2130,7 +2370,7 @@ func (v *VaultUsage) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VaultUsageList. func (v VaultUsageList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", v.Value) return json.Marshal(objectMap) } @@ -2155,7 +2395,7 @@ func (v *VaultUsageList) UnmarshalJSON(data []byte) error { return nil } -func populate(m map[string]interface{}, k string, v interface{}) { +func populate(m map[string]any, k string, v any) { if v == nil { return } else if azcore.IsNullValue(v) { @@ -2165,7 +2405,7 @@ func populate(m map[string]interface{}, k string, v interface{}) { } } -func populateByteArray(m map[string]interface{}, k string, b []byte, f runtime.Base64Encoding) { +func populateByteArray(m map[string]any, k string, b []byte, f runtime.Base64Encoding) { if azcore.IsNullValue(b) { m[k] = nil } else if len(b) == 0 { @@ -2175,7 +2415,7 @@ func populateByteArray(m map[string]interface{}, k string, b []byte, f runtime.B } } -func unpopulate(data json.RawMessage, fn string, v interface{}) error { +func unpopulate(data json.RawMessage, fn string, v any) error { if data == nil { return nil } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/operations_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/operations_client.go index d2a98dbddf2d..e25ceb303f9b 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/operations_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/operations_client.go @@ -32,9 +32,9 @@ type OperationsClient struct { } // NewOperationsClient creates a new instance of OperationsClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewOperationsClient(subscriptionID string, credential azcore.TokenCredentia // GetOperationResult - Gets the operation result for a resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// vaultName - The name of the recovery services vault. -// options - OperationsClientGetOperationResultOptions contains the optional parameters for the OperationsClient.GetOperationResult -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vaultName - The name of the recovery services vault. +// - options - OperationsClientGetOperationResultOptions contains the optional parameters for the OperationsClient.GetOperationResult +// method. func (client *OperationsClient) GetOperationResult(ctx context.Context, resourceGroupName string, vaultName string, operationID string, options *OperationsClientGetOperationResultOptions) (OperationsClientGetOperationResultResponse, error) { req, err := client.getOperationResultCreateRequest(ctx, resourceGroupName, vaultName, operationID, options) if err != nil { @@ -101,7 +102,7 @@ func (client *OperationsClient) getOperationResultCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,9 +118,9 @@ func (client *OperationsClient) getOperationResultHandleResponse(resp *http.Resp } // NewListPager - Returns the list of available operations. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// +// Generated from API version 2023-01-01 +// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ More: func(page OperationsClientListResponse) bool { @@ -156,7 +157,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -173,11 +174,12 @@ func (client *OperationsClient) listHandleResponse(resp *http.Response) (Operati // OperationStatusGet - Gets the operation status for a resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// vaultName - The name of the recovery services vault. -// options - OperationsClientOperationStatusGetOptions contains the optional parameters for the OperationsClient.OperationStatusGet -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vaultName - The name of the recovery services vault. +// - options - OperationsClientOperationStatusGetOptions contains the optional parameters for the OperationsClient.OperationStatusGet +// method. func (client *OperationsClient) OperationStatusGet(ctx context.Context, resourceGroupName string, vaultName string, operationID string, options *OperationsClientOperationStatusGetOptions) (OperationsClientOperationStatusGetResponse, error) { req, err := client.operationStatusGetCreateRequest(ctx, resourceGroupName, vaultName, operationID, options) if err != nil { @@ -217,7 +219,7 @@ func (client *OperationsClient) operationStatusGetCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/operations_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/operations_client_example_test.go deleted file mode 100644 index fa76294c0ea0..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/operations_client_example_test.go +++ /dev/null @@ -1,87 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armrecoveryservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservices" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/ListOperations.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservices.NewOperationsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/GetOperationStatus.json -func ExampleOperationsClient_OperationStatusGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservices.NewOperationsClient("77777777-b0c6-47a2-b37c-d8e65a629c18", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.OperationStatusGet(ctx, - "HelloWorld", - "swaggerExample", - "YWUzNDFkMzQtZmM5OS00MmUyLWEzNDMtZGJkMDIxZjlmZjgzOzdmYzBiMzhmLTc2NmItNDM5NS05OWQ1LTVmOGEzNzg4MWQzNA==", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/GetOperationResult.json -func ExampleOperationsClient_GetOperationResult() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservices.NewOperationsClient("77777777-b0c6-47a2-b37c-d8e65a629c18", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetOperationResult(ctx, - "HelloWorld", - "swaggerExample", - "YWUzNDFkMzQtZmM5OS00MmUyLWEzNDMtZGJkMDIxZjlmZjgzOzdmYzBiMzhmLTc2NmItNDM5NS05OWQ1LTVmOGEzNzg4MWQzNA==", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/polymorphic_helpers.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/polymorphic_helpers.go index 277349592490..be98fb62be44 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/polymorphic_helpers.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/polymorphic_helpers.go @@ -15,7 +15,7 @@ func unmarshalResourceCertificateDetailsClassification(rawMsg json.RawMessage) ( if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/privatelinkresources_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/privatelinkresources_client.go index 7d5902776bef..7915ec010bbe 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/privatelinkresources_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/privatelinkresources_client.go @@ -32,9 +32,9 @@ type PrivateLinkResourcesClient struct { } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - 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, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Returns a specified private link resource that need to be created for Backup and SiteRecovery // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// vaultName - The name of the recovery services vault. -// options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vaultName - The name of the recovery services vault. +// - options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get +// method. func (client *PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, vaultName string, privateLinkResourceName string, options *PrivateLinkResourcesClientGetOptions) (PrivateLinkResourcesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, vaultName, privateLinkResourceName, options) if err != nil { @@ -101,7 +102,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,12 +118,12 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) } // NewListPager - Returns the list of private link resources that need to be created for Backup and SiteRecovery -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// vaultName - The name of the recovery services vault. -// options - PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.List -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vaultName - The name of the recovery services vault. +// - options - PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListPager +// method. func (client *PrivateLinkResourcesClient) NewListPager(resourceGroupName string, vaultName string, options *PrivateLinkResourcesClientListOptions) *runtime.Pager[PrivateLinkResourcesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[PrivateLinkResourcesClientListResponse]{ More: func(page PrivateLinkResourcesClientListResponse) bool { @@ -171,7 +172,7 @@ func (client *PrivateLinkResourcesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/privatelinkresources_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/privatelinkresources_client_example_test.go deleted file mode 100644 index c6058ac09faa..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armrecoveryservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservices" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/ListPrivateLinkResources.json -func ExamplePrivateLinkResourcesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservices.NewPrivateLinkResourcesClient("6c48fa17-39c7-45f1-90ac-47a587128ace", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("petesting", - "pemsi-ecy-rsv2", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/GetPrivateLinkResources.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservices.NewPrivateLinkResourcesClient("6c48fa17-39c7-45f1-90ac-47a587128ace", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "petesting", - "pemsi-ecy-rsv2", - "backupResource", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/recoveryservices_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/recoveryservices_client_example_test.go deleted file mode 100644 index 0e511ad7b14e..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/recoveryservices_client_example_test.go +++ /dev/null @@ -1,44 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armrecoveryservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservices" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/CheckNameAvailability_Available.json -func ExampleClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservices.NewClient("77777777-b0c6-47a2-b37c-d8e65a629c18", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, - "resGroupFoo", - "westus", - armrecoveryservices.CheckNameAvailabilityParameters{ - Name: to.Ptr("swaggerExample"), - Type: to.Ptr("Microsoft.RecoveryServices/Vaults"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/registeredidentities_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/registeredidentities_client.go index a16a0adb1225..382b6489b56f 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/registeredidentities_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/registeredidentities_client.go @@ -32,9 +32,9 @@ type RegisteredIdentitiesClient struct { } // NewRegisteredIdentitiesClient creates a new instance of RegisteredIdentitiesClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewRegisteredIdentitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RegisteredIdentitiesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ func NewRegisteredIdentitiesClient(subscriptionID string, credential azcore.Toke // Delete - Unregisters the given container from your Recovery Services vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// vaultName - The name of the recovery services vault. -// identityName - Name of the protection container to unregister. -// options - RegisteredIdentitiesClientDeleteOptions contains the optional parameters for the RegisteredIdentitiesClient.Delete -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vaultName - The name of the recovery services vault. +// - identityName - Name of the protection container to unregister. +// - options - RegisteredIdentitiesClientDeleteOptions contains the optional parameters for the RegisteredIdentitiesClient.Delete +// method. func (client *RegisteredIdentitiesClient) Delete(ctx context.Context, resourceGroupName string, vaultName string, identityName string, options *RegisteredIdentitiesClientDeleteOptions) (RegisteredIdentitiesClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, vaultName, identityName, options) if err != nil { @@ -102,7 +103,7 @@ func (client *RegisteredIdentitiesClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/registeredidentities_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/registeredidentities_client_example_test.go deleted file mode 100644 index 64f3865125f9..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/registeredidentities_client_example_test.go +++ /dev/null @@ -1,38 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armrecoveryservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservices" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/DeleteRegisteredIdentities.json -func ExampleRegisteredIdentitiesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservices.NewRegisteredIdentitiesClient("77777777-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "BCDRIbzRG", - "BCDRIbzVault", - "dpmcontainer01", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/replicationusages_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/replicationusages_client.go index 3b038b78524c..90bdbadcb569 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/replicationusages_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/replicationusages_client.go @@ -32,9 +32,9 @@ type ReplicationUsagesClient struct { } // NewReplicationUsagesClient creates a new instance of ReplicationUsagesClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewReplicationUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ReplicationUsagesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,11 +56,12 @@ func NewReplicationUsagesClient(subscriptionID string, credential azcore.TokenCr } // NewListPager - Fetches the replication usages of the vault. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// vaultName - The name of the recovery services vault. -// options - ReplicationUsagesClientListOptions contains the optional parameters for the ReplicationUsagesClient.List method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vaultName - The name of the recovery services vault. +// - options - ReplicationUsagesClientListOptions contains the optional parameters for the ReplicationUsagesClient.NewListPager +// method. func (client *ReplicationUsagesClient) NewListPager(resourceGroupName string, vaultName string, options *ReplicationUsagesClientListOptions) *runtime.Pager[ReplicationUsagesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationUsagesClientListResponse]{ More: func(page ReplicationUsagesClientListResponse) bool { @@ -103,7 +104,7 @@ func (client *ReplicationUsagesClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/replicationusages_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/replicationusages_client_example_test.go deleted file mode 100644 index 683af3323bb0..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/replicationusages_client_example_test.go +++ /dev/null @@ -1,43 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armrecoveryservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservices" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/ListReplicationUsages.json -func ExampleReplicationUsagesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservices.NewReplicationUsagesClient("6808dbbc-98c7-431f-a1b1-9580902423b7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("avrai7517RG1", - "avrai7517Vault1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/response_types.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/response_types.go index c782d98d6330..70d5686afbd0 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/response_types.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/response_types.go @@ -9,6 +9,11 @@ package armrecoveryservices +// ClientCapabilitiesResponse contains the response from method Client.Capabilities. +type ClientCapabilitiesResponse struct { + CapabilitiesResponse +} + // ClientCheckNameAvailabilityResponse contains the response from method Client.CheckNameAvailability. type ClientCheckNameAvailabilityResponse struct { CheckNameAvailabilityResult @@ -19,7 +24,7 @@ type OperationsClientGetOperationResultResponse struct { Vault } -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { ClientDiscoveryResponse } @@ -34,7 +39,7 @@ type PrivateLinkResourcesClientGetResponse struct { PrivateLinkResource } -// PrivateLinkResourcesClientListResponse contains the response from method PrivateLinkResourcesClient.List. +// PrivateLinkResourcesClientListResponse contains the response from method PrivateLinkResourcesClient.NewListPager. type PrivateLinkResourcesClientListResponse struct { PrivateLinkResources } @@ -44,12 +49,12 @@ type RegisteredIdentitiesClientDeleteResponse struct { // placeholder for future response values } -// ReplicationUsagesClientListResponse contains the response from method ReplicationUsagesClient.List. +// ReplicationUsagesClientListResponse contains the response from method ReplicationUsagesClient.NewListPager. type ReplicationUsagesClientListResponse struct { ReplicationUsageList } -// UsagesClientListByVaultsResponse contains the response from method UsagesClient.ListByVaults. +// UsagesClientListByVaultsResponse contains the response from method UsagesClient.NewListByVaultsPager. type UsagesClientListByVaultsResponse struct { VaultUsageList } @@ -74,7 +79,7 @@ type VaultExtendedInfoClientUpdateResponse struct { VaultExtendedInfoResource } -// VaultsClientCreateOrUpdateResponse contains the response from method VaultsClient.CreateOrUpdate. +// VaultsClientCreateOrUpdateResponse contains the response from method VaultsClient.BeginCreateOrUpdate. type VaultsClientCreateOrUpdateResponse struct { Vault } @@ -89,17 +94,17 @@ type VaultsClientGetResponse struct { Vault } -// VaultsClientListByResourceGroupResponse contains the response from method VaultsClient.ListByResourceGroup. +// VaultsClientListByResourceGroupResponse contains the response from method VaultsClient.NewListByResourceGroupPager. type VaultsClientListByResourceGroupResponse struct { VaultList } -// VaultsClientListBySubscriptionIDResponse contains the response from method VaultsClient.ListBySubscriptionID. +// VaultsClientListBySubscriptionIDResponse contains the response from method VaultsClient.NewListBySubscriptionIDPager. type VaultsClientListBySubscriptionIDResponse struct { VaultList } -// VaultsClientUpdateResponse contains the response from method VaultsClient.Update. +// VaultsClientUpdateResponse contains the response from method VaultsClient.BeginUpdate. type VaultsClientUpdateResponse struct { Vault } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/time_rfc3339.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/time_rfc3339.go index 9fa74ddca7ae..ec09c0835d71 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/time_rfc3339.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/time_rfc3339.go @@ -62,7 +62,7 @@ func (t *timeRFC3339) Parse(layout, value string) error { return err } -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/usages_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/usages_client.go index b235f0132500..feb3ed24a003 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/usages_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/usages_client.go @@ -32,9 +32,9 @@ type UsagesClient struct { } // NewUsagesClient creates a new instance of UsagesClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - 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, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,11 +56,11 @@ func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, o } // NewListByVaultsPager - Fetches the usages of the vault. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// vaultName - The name of the recovery services vault. -// options - UsagesClientListByVaultsOptions contains the optional parameters for the UsagesClient.ListByVaults method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vaultName - The name of the recovery services vault. +// - options - UsagesClientListByVaultsOptions contains the optional parameters for the UsagesClient.NewListByVaultsPager method. func (client *UsagesClient) NewListByVaultsPager(resourceGroupName string, vaultName string, options *UsagesClientListByVaultsOptions) *runtime.Pager[UsagesClientListByVaultsResponse] { return runtime.NewPager(runtime.PagingHandler[UsagesClientListByVaultsResponse]{ More: func(page UsagesClientListByVaultsResponse) bool { @@ -103,7 +103,7 @@ func (client *UsagesClient) listByVaultsCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/usages_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/usages_client_example_test.go deleted file mode 100644 index ed094c74971a..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/usages_client_example_test.go +++ /dev/null @@ -1,43 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armrecoveryservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservices" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/ListUsages.json -func ExampleUsagesClient_NewListByVaultsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservices.NewUsagesClient("77777777-b0c6-47a2-b37c-d8e65a629c18", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByVaultsPager("Default-RecoveryServices-ResourceGroup", - "swaggerExample", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultcertificates_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultcertificates_client.go index fa28d638a327..369123f6f814 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultcertificates_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultcertificates_client.go @@ -32,9 +32,9 @@ type VaultCertificatesClient struct { } // NewVaultCertificatesClient creates a new instance of VaultCertificatesClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewVaultCertificatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VaultCertificatesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +57,14 @@ func NewVaultCertificatesClient(subscriptionID string, credential azcore.TokenCr // Create - Uploads a certificate for a resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// vaultName - The name of the recovery services vault. -// certificateName - Certificate friendly name. -// certificateRequest - Input parameters for uploading the vault certificate. -// options - VaultCertificatesClientCreateOptions contains the optional parameters for the VaultCertificatesClient.Create -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vaultName - The name of the recovery services vault. +// - certificateName - Certificate friendly name. +// - certificateRequest - Input parameters for uploading the vault certificate. +// - options - VaultCertificatesClientCreateOptions contains the optional parameters for the VaultCertificatesClient.Create +// method. func (client *VaultCertificatesClient) Create(ctx context.Context, resourceGroupName string, vaultName string, certificateName string, certificateRequest CertificateRequest, options *VaultCertificatesClientCreateOptions) (VaultCertificatesClientCreateResponse, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, vaultName, certificateName, certificateRequest, options) if err != nil { @@ -103,7 +104,7 @@ func (client *VaultCertificatesClient) createCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, certificateRequest) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultcertificates_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultcertificates_client_example_test.go deleted file mode 100644 index 205379e99453..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultcertificates_client_example_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armrecoveryservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservices" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/PUTVaultCred.json -func ExampleVaultCertificatesClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservices.NewVaultCertificatesClient("77777777-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "BCDRIbzRG", - "BCDRIbzVault", - "BCDRIbzVault77777777-d41f-4550-9f70-7708a3a2283b-12-18-2017-vaultcredentials", - armrecoveryservices.CertificateRequest{ - Properties: &armrecoveryservices.RawCertificateData{ - AuthType: to.Ptr(armrecoveryservices.AuthTypeAAD), - Certificate: []byte("MTTC3TCCAcWgAwIBAgIQEj9h+ZLlXK9KrqZX9UkAnzANBgkqhkiG9w0BAQUFADAeMRwwGgYDVQQDExNXaW5kb3dzIEF6dXJlIFRvb2xzMB4XDTE3MTIxODA5MTc1M1oXDTE3MTIyMzA5Mjc1M1owHjEcMBoGA1UEAxMTV2luZG93cyBBenVyZSBUb29sczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK773/eZZ69RbZZAT05r9MjUxu9y1L1Pn1EgPk62IPJyHlO3OZA922eSBahhP4bgmFljN4LVReqQ5eT/wqO0Zhc+yFkUy4U4RdbQLeUZt2W7yy9XLXgVvqeYDgsjg/QhHetgHArQBW+tlQq5+zPdU7zchI4rbShSJrWhLrZFWiOyFPsuAE4joUQHNlRifdCTsBGKk8HRCY3j1S3c4bfEn3zxlrvrXXssRuW5mJM95rMk0tskoRxXSCi6i9bnlki2Cs9mpVMmBFeofs41KwzlWU0TgpdD8s1QEdvfGB5NbByfetPX7MfJaTBeHZEGbv/Iq8l72u8sPBoOhcaH7qDE/mECAwEAAaMXMBUwEwYDVR0lBAwwCgYIKwYBBQUHAwIwDQYJKoZIhvcNAQEFBQADggEBAILfgHluye1Q+WelhgWhpBBdIq2C0btfV8eFsZaTlBUrM0fwpxQSlAWc2oYHVMQI4A5iUjbDOY35O4yc+TnWKDBKf+laqDP+yos4aiUPuadGUZfvDk7kuw7xeECs64JpHAIEKdRHFW9rD3gwG+nIWaDnEL/7rTyhL3kXrRW2MSUAL8g3GX8Z45c+MQY0jmASIqWdhGn1vpAGyA9mKkzsqg7FXjg8GZb24tGl5Ky85+ip4dkBfXinDD8WwaGyjhGGK97ErvNmN36qly/H0H1Qngiovg1FbHDmkcFO5QclnEJsFFmcO2CcHp5Fqh2wXn5O1cQaxCIRTpQ/uXRpDjl2wKs="), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultextendedinfo_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultextendedinfo_client.go index f82f62417526..abfe9bb5fb05 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultextendedinfo_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultextendedinfo_client.go @@ -32,9 +32,9 @@ type VaultExtendedInfoClient struct { } // NewVaultExtendedInfoClient creates a new instance of VaultExtendedInfoClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewVaultExtendedInfoClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VaultExtendedInfoClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ func NewVaultExtendedInfoClient(subscriptionID string, credential azcore.TokenCr // CreateOrUpdate - Create vault extended info. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// vaultName - The name of the recovery services vault. -// resourceExtendedInfoDetails - Details of ResourceExtendedInfo -// options - VaultExtendedInfoClientCreateOrUpdateOptions contains the optional parameters for the VaultExtendedInfoClient.CreateOrUpdate -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vaultName - The name of the recovery services vault. +// - resourceExtendedInfoDetails - Details of ResourceExtendedInfo +// - options - VaultExtendedInfoClientCreateOrUpdateOptions contains the optional parameters for the VaultExtendedInfoClient.CreateOrUpdate +// method. func (client *VaultExtendedInfoClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, vaultName string, resourceExtendedInfoDetails VaultExtendedInfoResource, options *VaultExtendedInfoClientCreateOrUpdateOptions) (VaultExtendedInfoClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vaultName, resourceExtendedInfoDetails, options) if err != nil { @@ -98,7 +99,7 @@ func (client *VaultExtendedInfoClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resourceExtendedInfoDetails) @@ -115,10 +116,11 @@ func (client *VaultExtendedInfoClient) createOrUpdateHandleResponse(resp *http.R // Get - Get the vault extended info. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// vaultName - The name of the recovery services vault. -// options - VaultExtendedInfoClientGetOptions contains the optional parameters for the VaultExtendedInfoClient.Get method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vaultName - The name of the recovery services vault. +// - options - VaultExtendedInfoClientGetOptions contains the optional parameters for the VaultExtendedInfoClient.Get method. func (client *VaultExtendedInfoClient) Get(ctx context.Context, resourceGroupName string, vaultName string, options *VaultExtendedInfoClientGetOptions) (VaultExtendedInfoClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, vaultName, options) if err != nil { @@ -154,7 +156,7 @@ func (client *VaultExtendedInfoClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,12 +173,13 @@ func (client *VaultExtendedInfoClient) getHandleResponse(resp *http.Response) (V // Update - Update vault extended info. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// vaultName - The name of the recovery services vault. -// resourceExtendedInfoDetails - Details of ResourceExtendedInfo -// options - VaultExtendedInfoClientUpdateOptions contains the optional parameters for the VaultExtendedInfoClient.Update -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vaultName - The name of the recovery services vault. +// - resourceExtendedInfoDetails - Details of ResourceExtendedInfo +// - options - VaultExtendedInfoClientUpdateOptions contains the optional parameters for the VaultExtendedInfoClient.Update +// method. func (client *VaultExtendedInfoClient) Update(ctx context.Context, resourceGroupName string, vaultName string, resourceExtendedInfoDetails VaultExtendedInfoResource, options *VaultExtendedInfoClientUpdateOptions) (VaultExtendedInfoClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, vaultName, resourceExtendedInfoDetails, options) if err != nil { @@ -212,7 +215,7 @@ func (client *VaultExtendedInfoClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resourceExtendedInfoDetails) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultextendedinfo_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultextendedinfo_client_example_test.go deleted file mode 100644 index 301fe5541898..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaultextendedinfo_client_example_test.go +++ /dev/null @@ -1,85 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armrecoveryservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservices" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/GETVaultExtendedInfo.json -func ExampleVaultExtendedInfoClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservices.NewVaultExtendedInfoClient("77777777-b0c6-47a2-b37c-d8e65a629c18", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-RecoveryServices-ResourceGroup", - "swaggerExample", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/UpdateVaultExtendedInfo.json -func ExampleVaultExtendedInfoClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservices.NewVaultExtendedInfoClient("77777777-b0c6-47a2-b37c-d8e65a629c18", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "Default-RecoveryServices-ResourceGroup", - "swaggerExample", - armrecoveryservices.VaultExtendedInfoResource{}, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/UpdateVaultExtendedInfo.json -func ExampleVaultExtendedInfoClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservices.NewVaultExtendedInfoClient("77777777-b0c6-47a2-b37c-d8e65a629c18", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "Default-RecoveryServices-ResourceGroup", - "swaggerExample", - armrecoveryservices.VaultExtendedInfoResource{}, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaults_client.go index c6455524be2c..21d6cde722ff 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaults_client.go @@ -32,9 +32,9 @@ type VaultsClient struct { } // NewVaultsClient creates a new instance of VaultsClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewVaultsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VaultsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ func NewVaultsClient(subscriptionID string, credential azcore.TokenCredential, o // BeginCreateOrUpdate - Creates or updates a Recovery Services vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// vaultName - The name of the recovery services vault. -// vault - Recovery Services Vault to be created. -// options - VaultsClientBeginCreateOrUpdateOptions contains the optional parameters for the VaultsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vaultName - The name of the recovery services vault. +// - vault - Recovery Services Vault to be created. +// - options - VaultsClientBeginCreateOrUpdateOptions contains the optional parameters for the VaultsClient.BeginCreateOrUpdate +// method. func (client *VaultsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vaultName string, vault Vault, options *VaultsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VaultsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, vaultName, vault, options) @@ -77,7 +78,8 @@ func (client *VaultsClient) BeginCreateOrUpdate(ctx context.Context, resourceGro // CreateOrUpdate - Creates or updates a Recovery Services vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// +// Generated from API version 2023-01-01 func (client *VaultsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vaultName string, vault Vault, options *VaultsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vaultName, vault, options) if err != nil { @@ -113,7 +115,7 @@ func (client *VaultsClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, vault) @@ -121,10 +123,11 @@ func (client *VaultsClient) createOrUpdateCreateRequest(ctx context.Context, res // Delete - Deletes a vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// vaultName - The name of the recovery services vault. -// options - VaultsClientDeleteOptions contains the optional parameters for the VaultsClient.Delete method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vaultName - The name of the recovery services vault. +// - options - VaultsClientDeleteOptions contains the optional parameters for the VaultsClient.Delete method. func (client *VaultsClient) Delete(ctx context.Context, resourceGroupName string, vaultName string, options *VaultsClientDeleteOptions) (VaultsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, vaultName, options) if err != nil { @@ -160,7 +163,7 @@ func (client *VaultsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -168,10 +171,11 @@ func (client *VaultsClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Get the Vault details. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// vaultName - The name of the recovery services vault. -// options - VaultsClientGetOptions contains the optional parameters for the VaultsClient.Get method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vaultName - The name of the recovery services vault. +// - options - VaultsClientGetOptions contains the optional parameters for the VaultsClient.Get method. func (client *VaultsClient) Get(ctx context.Context, resourceGroupName string, vaultName string, options *VaultsClientGetOptions) (VaultsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, vaultName, options) if err != nil { @@ -207,7 +211,7 @@ func (client *VaultsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -223,11 +227,11 @@ func (client *VaultsClient) getHandleResponse(resp *http.Response) (VaultsClient } // NewListByResourceGroupPager - Retrieve a list of Vaults. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// options - VaultsClientListByResourceGroupOptions contains the optional parameters for the VaultsClient.ListByResourceGroup -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - VaultsClientListByResourceGroupOptions contains the optional parameters for the VaultsClient.NewListByResourceGroupPager +// method. func (client *VaultsClient) NewListByResourceGroupPager(resourceGroupName string, options *VaultsClientListByResourceGroupOptions) *runtime.Pager[VaultsClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[VaultsClientListByResourceGroupResponse]{ More: func(page VaultsClientListByResourceGroupResponse) bool { @@ -272,7 +276,7 @@ func (client *VaultsClient) listByResourceGroupCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -288,10 +292,10 @@ func (client *VaultsClient) listByResourceGroupHandleResponse(resp *http.Respons } // NewListBySubscriptionIDPager - Fetches all the resources of the specified type in the subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 -// options - VaultsClientListBySubscriptionIDOptions contains the optional parameters for the VaultsClient.ListBySubscriptionID -// method. +// +// Generated from API version 2023-01-01 +// - options - VaultsClientListBySubscriptionIDOptions contains the optional parameters for the VaultsClient.NewListBySubscriptionIDPager +// method. func (client *VaultsClient) NewListBySubscriptionIDPager(options *VaultsClientListBySubscriptionIDOptions) *runtime.Pager[VaultsClientListBySubscriptionIDResponse] { return runtime.NewPager(runtime.PagingHandler[VaultsClientListBySubscriptionIDResponse]{ More: func(page VaultsClientListBySubscriptionIDResponse) bool { @@ -332,7 +336,7 @@ func (client *VaultsClient) listBySubscriptionIDCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -349,11 +353,12 @@ func (client *VaultsClient) listBySubscriptionIDHandleResponse(resp *http.Respon // BeginUpdate - Updates the vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// vaultName - The name of the recovery services vault. -// vault - Recovery Services Vault to be created. -// options - VaultsClientBeginUpdateOptions contains the optional parameters for the VaultsClient.BeginUpdate method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - vaultName - The name of the recovery services vault. +// - vault - Recovery Services Vault to be created. +// - options - VaultsClientBeginUpdateOptions contains the optional parameters for the VaultsClient.BeginUpdate method. func (client *VaultsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vaultName string, vault PatchVault, options *VaultsClientBeginUpdateOptions) (*runtime.Poller[VaultsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, vaultName, vault, options) @@ -368,7 +373,8 @@ func (client *VaultsClient) BeginUpdate(ctx context.Context, resourceGroupName s // Update - Updates the vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// +// Generated from API version 2023-01-01 func (client *VaultsClient) update(ctx context.Context, resourceGroupName string, vaultName string, vault PatchVault, options *VaultsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, vaultName, vault, options) if err != nil { @@ -404,7 +410,7 @@ func (client *VaultsClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, vault) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaults_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaults_client_example_test.go deleted file mode 100644 index 3b62506a466b..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservices/vaults_client_example_test.go +++ /dev/null @@ -1,152 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armrecoveryservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservices" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/ListResources.json -func ExampleVaultsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservices.NewVaultsClient("77777777-b0c6-47a2-b37c-d8e65a629c18", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("Default-RecoveryServices-ResourceGroup", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/GETVault.json -func ExampleVaultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservices.NewVaultsClient("77777777-b0c6-47a2-b37c-d8e65a629c18", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-RecoveryServices-ResourceGroup", - "swaggerExample", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/PUTVault.json -func ExampleVaultsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservices.NewVaultsClient("77777777-b0c6-47a2-b37c-d8e65a629c18", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default-RecoveryServices-ResourceGroup", - "swaggerExample", - armrecoveryservices.Vault{ - Location: to.Ptr("West US"), - Identity: &armrecoveryservices.IdentityData{ - Type: to.Ptr(armrecoveryservices.ResourceIdentityTypeSystemAssigned), - }, - Properties: &armrecoveryservices.VaultProperties{}, - SKU: &armrecoveryservices.SKU{ - Name: to.Ptr(armrecoveryservices.SKUNameStandard), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/DeleteVault.json -func ExampleVaultsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservices.NewVaultsClient("77777777-b0c6-47a2-b37c-d8e65a629c18", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "Default-RecoveryServices-ResourceGroup", - "swaggerExample", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2022-04-01/examples/PATCHVault.json -func ExampleVaultsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservices.NewVaultsClient("77777777-b0c6-47a2-b37c-d8e65a629c18", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "HelloWorld", - "swaggerExample", - armrecoveryservices.PatchVault{ - Tags: map[string]*string{ - "PatchKey": to.Ptr("PatchKeyUpdated"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -}