diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/CHANGELOG.md b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/CHANGELOG.md index 3f63ea3f2a2a..4c79b8944c06 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/CHANGELOG.md +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/CHANGELOG.md @@ -1,5 +1,34 @@ # Release History +## 2.1.0 (2023-08-07) +### Features Added + +- New enum type `ChurnOptionSelected` with values `ChurnOptionSelectedHigh`, `ChurnOptionSelectedNormal` +- New enum type `SecurityType` with values `SecurityTypeConfidentialVM`, `SecurityTypeNone`, `SecurityTypeTrustedLaunch` +- New struct `A2AFabricSpecificLocationDetails` +- New struct `ApplianceMonitoringDetails` +- New struct `ApplianceResourceDetails` +- New struct `DataStoreUtilizationDetails` +- New struct `GatewayOperationDetails` +- New struct `OSUpgradeSupportedVersions` +- New struct `VMwareCbtSecurityProfileProperties` +- New field `ChurnOptionSelected` in struct `A2AReplicationDetails` +- New field `LocationDetails` in struct `AzureFabricSpecificDetails` +- New field `ExtendedLocationMappings`, `LocationDetails` in struct `FabricQueryParameter` +- New field `OSUpgradeVersion` in struct `HyperVReplicaAzurePlannedFailoverProviderInput` +- New field `AllAvailableOSUpgradeConfigurations` in struct `HyperVReplicaAzureReplicationDetails` +- New field `OSUpgradeVersion` in struct `HyperVReplicaAzureTestFailoverInput` +- New field `AllAvailableOSUpgradeConfigurations`, `OSName`, `SupportedOSVersions` in struct `InMageAzureV2ReplicationDetails` +- New field `OSUpgradeVersion` in struct `InMageAzureV2TestFailoverInput` +- New field `OSUpgradeVersion` in struct `InMageAzureV2UnplannedFailoverInput` +- New field `ConfidentialVMKeyVaultID`, `TargetVMSecurityProfile` in struct `VMwareCbtEnableMigrationInput` +- New field `OSUpgradeVersion` in struct `VMwareCbtMigrateInput` +- New field `ApplianceMonitoringDetails`, `ConfidentialVMKeyVaultID`, `DeltaSyncProgressPercentage`, `DeltaSyncRetryCount`, `GatewayOperationDetails`, `IsCheckSumResyncCycle`, `OSName`, `OperationName`, `SupportedOSVersions`, `TargetVMSecurityProfile` in struct `VMwareCbtMigrationDetails` +- New field `GatewayOperationDetails` in struct `VMwareCbtProtectedDiskDetails` +- New field `ExcludedSKUs` in struct `VMwareCbtProtectionContainerMappingDetails` +- New field `OSUpgradeVersion` in struct `VMwareCbtTestMigrateInput` + + ## 2.0.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/autorest.md b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/autorest.md index c74ac3f6da9a..1070cf5f7867 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/autorest.md +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/recoveryservicessiterecovery/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/recoveryservicessiterecovery/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.0.1 -tag: package-2022-10 +module-version: 2.1.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/client_factory.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/client_factory.go index 8ca1ea665d02..23802cd31564 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/client_factory.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/client_factory.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -38,11 +37,21 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } +func (c *ClientFactory) NewMigrationRecoveryPointsClient() *MigrationRecoveryPointsClient { + subClient, _ := NewMigrationRecoveryPointsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewOperationsClient() *OperationsClient { subClient, _ := NewOperationsClient(c.subscriptionID, c.credential, c.options) return subClient } +func (c *ClientFactory) NewRecoveryPointsClient() *RecoveryPointsClient { + subClient, _ := NewRecoveryPointsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewReplicationAlertSettingsClient() *ReplicationAlertSettingsClient { subClient, _ := NewReplicationAlertSettingsClient(c.subscriptionID, c.credential, c.options) return subClient @@ -68,13 +77,18 @@ func (c *ClientFactory) NewReplicationFabricsClient() *ReplicationFabricsClient return subClient } +func (c *ClientFactory) NewReplicationJobsClient() *ReplicationJobsClient { + subClient, _ := NewReplicationJobsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewReplicationLogicalNetworksClient() *ReplicationLogicalNetworksClient { subClient, _ := NewReplicationLogicalNetworksClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewReplicationNetworksClient() *ReplicationNetworksClient { - subClient, _ := NewReplicationNetworksClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewReplicationMigrationItemsClient() *ReplicationMigrationItemsClient { + subClient, _ := NewReplicationMigrationItemsClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -83,18 +97,13 @@ func (c *ClientFactory) NewReplicationNetworkMappingsClient() *ReplicationNetwor return subClient } -func (c *ClientFactory) NewReplicationProtectionContainersClient() *ReplicationProtectionContainersClient { - subClient, _ := NewReplicationProtectionContainersClient(c.subscriptionID, c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewReplicationMigrationItemsClient() *ReplicationMigrationItemsClient { - subClient, _ := NewReplicationMigrationItemsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewReplicationNetworksClient() *ReplicationNetworksClient { + subClient, _ := NewReplicationNetworksClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewMigrationRecoveryPointsClient() *MigrationRecoveryPointsClient { - subClient, _ := NewMigrationRecoveryPointsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewReplicationPoliciesClient() *ReplicationPoliciesClient { + subClient, _ := NewReplicationPoliciesClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -108,28 +117,28 @@ func (c *ClientFactory) NewReplicationProtectedItemsClient() *ReplicationProtect return subClient } -func (c *ClientFactory) NewRecoveryPointsClient() *RecoveryPointsClient { - subClient, _ := NewRecoveryPointsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewReplicationProtectionContainerMappingsClient() *ReplicationProtectionContainerMappingsClient { + subClient, _ := NewReplicationProtectionContainerMappingsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewTargetComputeSizesClient() *TargetComputeSizesClient { - subClient, _ := NewTargetComputeSizesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewReplicationProtectionContainersClient() *ReplicationProtectionContainersClient { + subClient, _ := NewReplicationProtectionContainersClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewReplicationProtectionContainerMappingsClient() *ReplicationProtectionContainerMappingsClient { - subClient, _ := NewReplicationProtectionContainerMappingsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewReplicationProtectionIntentsClient() *ReplicationProtectionIntentsClient { + subClient, _ := NewReplicationProtectionIntentsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewReplicationRecoveryServicesProvidersClient() *ReplicationRecoveryServicesProvidersClient { - subClient, _ := NewReplicationRecoveryServicesProvidersClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewReplicationRecoveryPlansClient() *ReplicationRecoveryPlansClient { + subClient, _ := NewReplicationRecoveryPlansClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewReplicationStorageClassificationsClient() *ReplicationStorageClassificationsClient { - subClient, _ := NewReplicationStorageClassificationsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewReplicationRecoveryServicesProvidersClient() *ReplicationRecoveryServicesProvidersClient { + subClient, _ := NewReplicationRecoveryServicesProvidersClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -138,28 +147,23 @@ func (c *ClientFactory) NewReplicationStorageClassificationMappingsClient() *Rep return subClient } -func (c *ClientFactory) NewReplicationvCentersClient() *ReplicationvCentersClient { - subClient, _ := NewReplicationvCentersClient(c.subscriptionID, c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewReplicationJobsClient() *ReplicationJobsClient { - subClient, _ := NewReplicationJobsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewReplicationStorageClassificationsClient() *ReplicationStorageClassificationsClient { + subClient, _ := NewReplicationStorageClassificationsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewReplicationPoliciesClient() *ReplicationPoliciesClient { - subClient, _ := NewReplicationPoliciesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewReplicationVaultHealthClient() *ReplicationVaultHealthClient { + subClient, _ := NewReplicationVaultHealthClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewReplicationProtectionIntentsClient() *ReplicationProtectionIntentsClient { - subClient, _ := NewReplicationProtectionIntentsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewReplicationVaultSettingClient() *ReplicationVaultSettingClient { + subClient, _ := NewReplicationVaultSettingClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewReplicationRecoveryPlansClient() *ReplicationRecoveryPlansClient { - subClient, _ := NewReplicationRecoveryPlansClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewReplicationvCentersClient() *ReplicationvCentersClient { + subClient, _ := NewReplicationvCentersClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -168,12 +172,7 @@ func (c *ClientFactory) NewSupportedOperatingSystemsClient() *SupportedOperating return subClient } -func (c *ClientFactory) NewReplicationVaultHealthClient() *ReplicationVaultHealthClient { - subClient, _ := NewReplicationVaultHealthClient(c.subscriptionID, c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewReplicationVaultSettingClient() *ReplicationVaultSettingClient { - subClient, _ := NewReplicationVaultSettingClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewTargetComputeSizesClient() *TargetComputeSizesClient { + subClient, _ := NewTargetComputeSizesClient(c.subscriptionID, c.credential, c.options) return subClient } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/constants.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/constants.go index 7ce0b7fe538d..f8d9edc29e6d 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/constants.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/constants.go @@ -3,15 +3,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery const ( moduleName = "armrecoveryservicessiterecovery" - moduleVersion = "v2.0.1" + moduleVersion = "v2.1.0" ) // A2ARecoveryAvailabilityType - The recovery availability type of the virtual machine. @@ -177,6 +176,22 @@ func PossibleAutomationAccountAuthenticationTypeValues() []AutomationAccountAuth } } +// ChurnOptionSelected - A value indicating the churn option selected by user. +type ChurnOptionSelected string + +const ( + ChurnOptionSelectedHigh ChurnOptionSelected = "High" + ChurnOptionSelectedNormal ChurnOptionSelected = "Normal" +) + +// PossibleChurnOptionSelectedValues returns the possible values for the ChurnOptionSelected const type. +func PossibleChurnOptionSelectedValues() []ChurnOptionSelected { + return []ChurnOptionSelected{ + ChurnOptionSelectedHigh, + ChurnOptionSelectedNormal, + } +} + // DataSyncStatus - The data sync option. type DataSyncStatus string @@ -857,6 +872,24 @@ func PossibleSQLServerLicenseTypeValues() []SQLServerLicenseType { } } +// SecurityType - The target VM security type. +type SecurityType string + +const ( + SecurityTypeConfidentialVM SecurityType = "ConfidentialVM" + SecurityTypeNone SecurityType = "None" + SecurityTypeTrustedLaunch SecurityType = "TrustedLaunch" +) + +// PossibleSecurityTypeValues returns the possible values for the SecurityType const type. +func PossibleSecurityTypeValues() []SecurityType { + return []SecurityType{ + SecurityTypeConfidentialVM, + SecurityTypeNone, + SecurityTypeTrustedLaunch, + } +} + // SetMultiVMSyncStatus - A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. type SetMultiVMSyncStatus string diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/go.mod b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/go.mod index cc1afc87a2b0..c9d3232b1c13 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/go.mod +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/ar go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/text v0.8.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/go.sum b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/go.sum index 8ba445a8c4da..5c6bee428364 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/go.sum +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/go.sum @@ -1,31 +1,15 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +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/armrecoveryservicessiterecovery/interfaces.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/interfaces.go new file mode 100644 index 000000000000..994859bc7cc5 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/interfaces.go @@ -0,0 +1,539 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armrecoveryservicessiterecovery + +// AddDisksProviderSpecificInputClassification provides polymorphic access to related types. +// Call the interface's GetAddDisksProviderSpecificInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2AAddDisksInput, *AddDisksProviderSpecificInput +type AddDisksProviderSpecificInputClassification interface { + // GetAddDisksProviderSpecificInput returns the AddDisksProviderSpecificInput content of the underlying type. + GetAddDisksProviderSpecificInput() *AddDisksProviderSpecificInput +} + +// ApplianceSpecificDetailsClassification provides polymorphic access to related types. +// Call the interface's GetApplianceSpecificDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ApplianceSpecificDetails, *InMageRcmApplianceSpecificDetails +type ApplianceSpecificDetailsClassification interface { + // GetApplianceSpecificDetails returns the ApplianceSpecificDetails content of the underlying type. + GetApplianceSpecificDetails() *ApplianceSpecificDetails +} + +// ApplyRecoveryPointProviderSpecificInputClassification provides polymorphic access to related types. +// Call the interface's GetApplyRecoveryPointProviderSpecificInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2AApplyRecoveryPointInput, *A2ACrossClusterMigrationApplyRecoveryPointInput, *ApplyRecoveryPointProviderSpecificInput, +// - *HyperVReplicaAzureApplyRecoveryPointInput, *InMageAzureV2ApplyRecoveryPointInput, *InMageRcmApplyRecoveryPointInput +type ApplyRecoveryPointProviderSpecificInputClassification interface { + // GetApplyRecoveryPointProviderSpecificInput returns the ApplyRecoveryPointProviderSpecificInput content of the underlying type. + GetApplyRecoveryPointProviderSpecificInput() *ApplyRecoveryPointProviderSpecificInput +} + +// ConfigurationSettingsClassification provides polymorphic access to related types. +// Call the interface's GetConfigurationSettings() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ConfigurationSettings, *HyperVVirtualMachineDetails, *ReplicationGroupDetails, *VMwareVirtualMachineDetails, *VmmVirtualMachineDetails +type ConfigurationSettingsClassification interface { + // GetConfigurationSettings returns the ConfigurationSettings content of the underlying type. + GetConfigurationSettings() *ConfigurationSettings +} + +// CreateProtectionIntentProviderSpecificDetailsClassification provides polymorphic access to related types. +// Call the interface's GetCreateProtectionIntentProviderSpecificDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2ACreateProtectionIntentInput, *CreateProtectionIntentProviderSpecificDetails +type CreateProtectionIntentProviderSpecificDetailsClassification interface { + // GetCreateProtectionIntentProviderSpecificDetails returns the CreateProtectionIntentProviderSpecificDetails content of the underlying type. + GetCreateProtectionIntentProviderSpecificDetails() *CreateProtectionIntentProviderSpecificDetails +} + +// DisableProtectionProviderSpecificInputClassification provides polymorphic access to related types. +// Call the interface's GetDisableProtectionProviderSpecificInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *DisableProtectionProviderSpecificInput, *InMageDisableProtectionProviderSpecificInput +type DisableProtectionProviderSpecificInputClassification interface { + // GetDisableProtectionProviderSpecificInput returns the DisableProtectionProviderSpecificInput content of the underlying type. + GetDisableProtectionProviderSpecificInput() *DisableProtectionProviderSpecificInput +} + +// EnableMigrationProviderSpecificInputClassification provides polymorphic access to related types. +// Call the interface's GetEnableMigrationProviderSpecificInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *EnableMigrationProviderSpecificInput, *VMwareCbtEnableMigrationInput +type EnableMigrationProviderSpecificInputClassification interface { + // GetEnableMigrationProviderSpecificInput returns the EnableMigrationProviderSpecificInput content of the underlying type. + GetEnableMigrationProviderSpecificInput() *EnableMigrationProviderSpecificInput +} + +// EnableProtectionProviderSpecificInputClassification provides polymorphic access to related types. +// Call the interface's GetEnableProtectionProviderSpecificInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2ACrossClusterMigrationEnableProtectionInput, *A2AEnableProtectionInput, *EnableProtectionProviderSpecificInput, *HyperVReplicaAzureEnableProtectionInput, +// - *InMageAzureV2EnableProtectionInput, *InMageEnableProtectionInput, *InMageRcmEnableProtectionInput +type EnableProtectionProviderSpecificInputClassification interface { + // GetEnableProtectionProviderSpecificInput returns the EnableProtectionProviderSpecificInput content of the underlying type. + GetEnableProtectionProviderSpecificInput() *EnableProtectionProviderSpecificInput +} + +// EventProviderSpecificDetailsClassification provides polymorphic access to related types. +// Call the interface's GetEventProviderSpecificDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2AEventDetails, *EventProviderSpecificDetails, *HyperVReplica2012EventDetails, *HyperVReplica2012R2EventDetails, *HyperVReplicaAzureEventDetails, +// - *HyperVReplicaBaseEventDetails, *InMageAzureV2EventDetails, *InMageRcmEventDetails, *InMageRcmFailbackEventDetails, *VMwareCbtEventDetails +type EventProviderSpecificDetailsClassification interface { + // GetEventProviderSpecificDetails returns the EventProviderSpecificDetails content of the underlying type. + GetEventProviderSpecificDetails() *EventProviderSpecificDetails +} + +// EventSpecificDetailsClassification provides polymorphic access to related types. +// Call the interface's GetEventSpecificDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *EventSpecificDetails, *JobStatusEventDetails +type EventSpecificDetailsClassification interface { + // GetEventSpecificDetails returns the EventSpecificDetails content of the underlying type. + GetEventSpecificDetails() *EventSpecificDetails +} + +// FabricSpecificCreateNetworkMappingInputClassification provides polymorphic access to related types. +// Call the interface's GetFabricSpecificCreateNetworkMappingInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureToAzureCreateNetworkMappingInput, *FabricSpecificCreateNetworkMappingInput, *VmmToAzureCreateNetworkMappingInput, +// - *VmmToVmmCreateNetworkMappingInput +type FabricSpecificCreateNetworkMappingInputClassification interface { + // GetFabricSpecificCreateNetworkMappingInput returns the FabricSpecificCreateNetworkMappingInput content of the underlying type. + GetFabricSpecificCreateNetworkMappingInput() *FabricSpecificCreateNetworkMappingInput +} + +// FabricSpecificCreationInputClassification provides polymorphic access to related types. +// Call the interface's GetFabricSpecificCreationInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureFabricCreationInput, *FabricSpecificCreationInput, *InMageRcmFabricCreationInput, *VMwareV2FabricCreationInput +type FabricSpecificCreationInputClassification interface { + // GetFabricSpecificCreationInput returns the FabricSpecificCreationInput content of the underlying type. + GetFabricSpecificCreationInput() *FabricSpecificCreationInput +} + +// FabricSpecificDetailsClassification provides polymorphic access to related types. +// Call the interface's GetFabricSpecificDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureFabricSpecificDetails, *FabricSpecificDetails, *HyperVSiteDetails, *InMageRcmFabricSpecificDetails, *VMwareDetails, +// - *VMwareV2FabricSpecificDetails, *VmmDetails +type FabricSpecificDetailsClassification interface { + // GetFabricSpecificDetails returns the FabricSpecificDetails content of the underlying type. + GetFabricSpecificDetails() *FabricSpecificDetails +} + +// FabricSpecificUpdateNetworkMappingInputClassification provides polymorphic access to related types. +// Call the interface's GetFabricSpecificUpdateNetworkMappingInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureToAzureUpdateNetworkMappingInput, *FabricSpecificUpdateNetworkMappingInput, *VmmToAzureUpdateNetworkMappingInput, +// - *VmmToVmmUpdateNetworkMappingInput +type FabricSpecificUpdateNetworkMappingInputClassification interface { + // GetFabricSpecificUpdateNetworkMappingInput returns the FabricSpecificUpdateNetworkMappingInput content of the underlying type. + GetFabricSpecificUpdateNetworkMappingInput() *FabricSpecificUpdateNetworkMappingInput +} + +// GroupTaskDetailsClassification provides polymorphic access to related types. +// Call the interface's GetGroupTaskDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *GroupTaskDetails, *InlineWorkflowTaskDetails, *RecoveryPlanGroupTaskDetails, *RecoveryPlanShutdownGroupTaskDetails +type GroupTaskDetailsClassification interface { + // GetGroupTaskDetails returns the GroupTaskDetails content of the underlying type. + GetGroupTaskDetails() *GroupTaskDetails +} + +// HyperVReplicaPolicyInputClassification provides polymorphic access to related types. +// Call the interface's GetHyperVReplicaPolicyInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *HyperVReplicaBluePolicyInput, *HyperVReplicaPolicyInput +type HyperVReplicaPolicyInputClassification interface { + PolicyProviderSpecificInputClassification + // GetHyperVReplicaPolicyInput returns the HyperVReplicaPolicyInput content of the underlying type. + GetHyperVReplicaPolicyInput() *HyperVReplicaPolicyInput +} + +// HyperVVirtualMachineDetailsClassification provides polymorphic access to related types. +// Call the interface's GetHyperVVirtualMachineDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *HyperVVirtualMachineDetails, *VmmVirtualMachineDetails +type HyperVVirtualMachineDetailsClassification interface { + ConfigurationSettingsClassification + // GetHyperVVirtualMachineDetails returns the HyperVVirtualMachineDetails content of the underlying type. + GetHyperVVirtualMachineDetails() *HyperVVirtualMachineDetails +} + +// JobDetailsClassification provides polymorphic access to related types. +// Call the interface's GetJobDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AsrJobDetails, *ExportJobDetails, *FailoverJobDetails, *JobDetails, *SwitchProtectionJobDetails, *TestFailoverJobDetails +type JobDetailsClassification interface { + // GetJobDetails returns the JobDetails content of the underlying type. + GetJobDetails() *JobDetails +} + +// JobTaskDetailsClassification provides polymorphic access to related types. +// Call the interface's GetJobTaskDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *FabricReplicationGroupTaskDetails, *JobTaskDetails, *VirtualMachineTaskDetails +type JobTaskDetailsClassification interface { + TaskTypeDetailsClassification + // GetJobTaskDetails returns the JobTaskDetails content of the underlying type. + GetJobTaskDetails() *JobTaskDetails +} + +// MigrateProviderSpecificInputClassification provides polymorphic access to related types. +// Call the interface's GetMigrateProviderSpecificInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *MigrateProviderSpecificInput, *VMwareCbtMigrateInput +type MigrateProviderSpecificInputClassification interface { + // GetMigrateProviderSpecificInput returns the MigrateProviderSpecificInput content of the underlying type. + GetMigrateProviderSpecificInput() *MigrateProviderSpecificInput +} + +// MigrationProviderSpecificSettingsClassification provides polymorphic access to related types. +// Call the interface's GetMigrationProviderSpecificSettings() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *MigrationProviderSpecificSettings, *VMwareCbtMigrationDetails +type MigrationProviderSpecificSettingsClassification interface { + // GetMigrationProviderSpecificSettings returns the MigrationProviderSpecificSettings content of the underlying type. + GetMigrationProviderSpecificSettings() *MigrationProviderSpecificSettings +} + +// NetworkMappingFabricSpecificSettingsClassification provides polymorphic access to related types. +// Call the interface's GetNetworkMappingFabricSpecificSettings() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureToAzureNetworkMappingSettings, *NetworkMappingFabricSpecificSettings, *VmmToAzureNetworkMappingSettings, *VmmToVmmNetworkMappingSettings +type NetworkMappingFabricSpecificSettingsClassification interface { + // GetNetworkMappingFabricSpecificSettings returns the NetworkMappingFabricSpecificSettings content of the underlying type. + GetNetworkMappingFabricSpecificSettings() *NetworkMappingFabricSpecificSettings +} + +// PlannedFailoverProviderSpecificFailoverInputClassification provides polymorphic access to related types. +// Call the interface's GetPlannedFailoverProviderSpecificFailoverInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *HyperVReplicaAzureFailbackProviderInput, *HyperVReplicaAzurePlannedFailoverProviderInput, *InMageRcmFailbackPlannedFailoverProviderInput, +// - *PlannedFailoverProviderSpecificFailoverInput +type PlannedFailoverProviderSpecificFailoverInputClassification interface { + // GetPlannedFailoverProviderSpecificFailoverInput returns the PlannedFailoverProviderSpecificFailoverInput content of the underlying type. + GetPlannedFailoverProviderSpecificFailoverInput() *PlannedFailoverProviderSpecificFailoverInput +} + +// PolicyProviderSpecificDetailsClassification provides polymorphic access to related types. +// Call the interface's GetPolicyProviderSpecificDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2APolicyDetails, *HyperVReplicaAzurePolicyDetails, *HyperVReplicaBasePolicyDetails, *HyperVReplicaBluePolicyDetails, +// - *HyperVReplicaPolicyDetails, *InMageAzureV2PolicyDetails, *InMageBasePolicyDetails, *InMagePolicyDetails, *InMageRcmFailbackPolicyDetails, +// - *InMageRcmPolicyDetails, *PolicyProviderSpecificDetails, *VmwareCbtPolicyDetails +type PolicyProviderSpecificDetailsClassification interface { + // GetPolicyProviderSpecificDetails returns the PolicyProviderSpecificDetails content of the underlying type. + GetPolicyProviderSpecificDetails() *PolicyProviderSpecificDetails +} + +// PolicyProviderSpecificInputClassification provides polymorphic access to related types. +// Call the interface's GetPolicyProviderSpecificInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2ACrossClusterMigrationPolicyCreationInput, *A2APolicyCreationInput, *HyperVReplicaAzurePolicyInput, *HyperVReplicaBluePolicyInput, +// - *HyperVReplicaPolicyInput, *InMageAzureV2PolicyInput, *InMagePolicyInput, *InMageRcmFailbackPolicyCreationInput, *InMageRcmPolicyCreationInput, +// - *PolicyProviderSpecificInput, *VMwareCbtPolicyCreationInput +type PolicyProviderSpecificInputClassification interface { + // GetPolicyProviderSpecificInput returns the PolicyProviderSpecificInput content of the underlying type. + GetPolicyProviderSpecificInput() *PolicyProviderSpecificInput +} + +// ProtectionContainerMappingProviderSpecificDetailsClassification provides polymorphic access to related types. +// Call the interface's GetProtectionContainerMappingProviderSpecificDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2AProtectionContainerMappingDetails, *InMageRcmProtectionContainerMappingDetails, *ProtectionContainerMappingProviderSpecificDetails, +// - *VMwareCbtProtectionContainerMappingDetails +type ProtectionContainerMappingProviderSpecificDetailsClassification interface { + // GetProtectionContainerMappingProviderSpecificDetails returns the ProtectionContainerMappingProviderSpecificDetails content of the underlying type. + GetProtectionContainerMappingProviderSpecificDetails() *ProtectionContainerMappingProviderSpecificDetails +} + +// ProtectionProfileCustomDetailsClassification provides polymorphic access to related types. +// Call the interface's GetProtectionProfileCustomDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ExistingProtectionProfile, *NewProtectionProfile, *ProtectionProfileCustomDetails +type ProtectionProfileCustomDetailsClassification interface { + // GetProtectionProfileCustomDetails returns the ProtectionProfileCustomDetails content of the underlying type. + GetProtectionProfileCustomDetails() *ProtectionProfileCustomDetails +} + +// ProviderSpecificRecoveryPointDetailsClassification provides polymorphic access to related types. +// Call the interface's GetProviderSpecificRecoveryPointDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2ARecoveryPointDetails, *InMageAzureV2RecoveryPointDetails, *InMageRcmRecoveryPointDetails, *ProviderSpecificRecoveryPointDetails +type ProviderSpecificRecoveryPointDetailsClassification interface { + // GetProviderSpecificRecoveryPointDetails returns the ProviderSpecificRecoveryPointDetails content of the underlying type. + GetProviderSpecificRecoveryPointDetails() *ProviderSpecificRecoveryPointDetails +} + +// RecoveryAvailabilitySetCustomDetailsClassification provides polymorphic access to related types. +// Call the interface's GetRecoveryAvailabilitySetCustomDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ExistingRecoveryAvailabilitySet, *RecoveryAvailabilitySetCustomDetails +type RecoveryAvailabilitySetCustomDetailsClassification interface { + // GetRecoveryAvailabilitySetCustomDetails returns the RecoveryAvailabilitySetCustomDetails content of the underlying type. + GetRecoveryAvailabilitySetCustomDetails() *RecoveryAvailabilitySetCustomDetails +} + +// RecoveryPlanActionDetailsClassification provides polymorphic access to related types. +// Call the interface's GetRecoveryPlanActionDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *RecoveryPlanActionDetails, *RecoveryPlanAutomationRunbookActionDetails, *RecoveryPlanManualActionDetails, *RecoveryPlanScriptActionDetails +type RecoveryPlanActionDetailsClassification interface { + // GetRecoveryPlanActionDetails returns the RecoveryPlanActionDetails content of the underlying type. + GetRecoveryPlanActionDetails() *RecoveryPlanActionDetails +} + +// RecoveryPlanGroupTaskDetailsClassification provides polymorphic access to related types. +// Call the interface's GetRecoveryPlanGroupTaskDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *RecoveryPlanGroupTaskDetails, *RecoveryPlanShutdownGroupTaskDetails +type RecoveryPlanGroupTaskDetailsClassification interface { + GroupTaskDetailsClassification + // GetRecoveryPlanGroupTaskDetails returns the RecoveryPlanGroupTaskDetails content of the underlying type. + GetRecoveryPlanGroupTaskDetails() *RecoveryPlanGroupTaskDetails +} + +// RecoveryPlanProviderSpecificDetailsClassification provides polymorphic access to related types. +// Call the interface's GetRecoveryPlanProviderSpecificDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *RecoveryPlanA2ADetails, *RecoveryPlanProviderSpecificDetails +type RecoveryPlanProviderSpecificDetailsClassification interface { + // GetRecoveryPlanProviderSpecificDetails returns the RecoveryPlanProviderSpecificDetails content of the underlying type. + GetRecoveryPlanProviderSpecificDetails() *RecoveryPlanProviderSpecificDetails +} + +// RecoveryPlanProviderSpecificFailoverInputClassification provides polymorphic access to related types. +// Call the interface's GetRecoveryPlanProviderSpecificFailoverInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *RecoveryPlanA2AFailoverInput, *RecoveryPlanHyperVReplicaAzureFailbackInput, *RecoveryPlanHyperVReplicaAzureFailoverInput, +// - *RecoveryPlanInMageAzureV2FailoverInput, *RecoveryPlanInMageFailoverInput, *RecoveryPlanInMageRcmFailbackFailoverInput, +// - *RecoveryPlanInMageRcmFailoverInput, *RecoveryPlanProviderSpecificFailoverInput +type RecoveryPlanProviderSpecificFailoverInputClassification interface { + // GetRecoveryPlanProviderSpecificFailoverInput returns the RecoveryPlanProviderSpecificFailoverInput content of the underlying type. + GetRecoveryPlanProviderSpecificFailoverInput() *RecoveryPlanProviderSpecificFailoverInput +} + +// RecoveryPlanProviderSpecificInputClassification provides polymorphic access to related types. +// Call the interface's GetRecoveryPlanProviderSpecificInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *RecoveryPlanA2AInput, *RecoveryPlanProviderSpecificInput +type RecoveryPlanProviderSpecificInputClassification interface { + // GetRecoveryPlanProviderSpecificInput returns the RecoveryPlanProviderSpecificInput content of the underlying type. + GetRecoveryPlanProviderSpecificInput() *RecoveryPlanProviderSpecificInput +} + +// RecoveryProximityPlacementGroupCustomDetailsClassification provides polymorphic access to related types. +// Call the interface's GetRecoveryProximityPlacementGroupCustomDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ExistingRecoveryProximityPlacementGroup, *RecoveryProximityPlacementGroupCustomDetails +type RecoveryProximityPlacementGroupCustomDetailsClassification interface { + // GetRecoveryProximityPlacementGroupCustomDetails returns the RecoveryProximityPlacementGroupCustomDetails content of the underlying type. + GetRecoveryProximityPlacementGroupCustomDetails() *RecoveryProximityPlacementGroupCustomDetails +} + +// RecoveryResourceGroupCustomDetailsClassification provides polymorphic access to related types. +// Call the interface's GetRecoveryResourceGroupCustomDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ExistingRecoveryResourceGroup, *RecoveryResourceGroupCustomDetails +type RecoveryResourceGroupCustomDetailsClassification interface { + // GetRecoveryResourceGroupCustomDetails returns the RecoveryResourceGroupCustomDetails content of the underlying type. + GetRecoveryResourceGroupCustomDetails() *RecoveryResourceGroupCustomDetails +} + +// RecoveryVirtualNetworkCustomDetailsClassification provides polymorphic access to related types. +// Call the interface's GetRecoveryVirtualNetworkCustomDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ExistingRecoveryVirtualNetwork, *NewRecoveryVirtualNetwork, *RecoveryVirtualNetworkCustomDetails +type RecoveryVirtualNetworkCustomDetailsClassification interface { + // GetRecoveryVirtualNetworkCustomDetails returns the RecoveryVirtualNetworkCustomDetails content of the underlying type. + GetRecoveryVirtualNetworkCustomDetails() *RecoveryVirtualNetworkCustomDetails +} + +// RemoveDisksProviderSpecificInputClassification provides polymorphic access to related types. +// Call the interface's GetRemoveDisksProviderSpecificInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2ARemoveDisksInput, *RemoveDisksProviderSpecificInput +type RemoveDisksProviderSpecificInputClassification interface { + // GetRemoveDisksProviderSpecificInput returns the RemoveDisksProviderSpecificInput content of the underlying type. + GetRemoveDisksProviderSpecificInput() *RemoveDisksProviderSpecificInput +} + +// ReplicationProtectionIntentProviderSpecificSettingsClassification provides polymorphic access to related types. +// Call the interface's GetReplicationProtectionIntentProviderSpecificSettings() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2AReplicationIntentDetails, *ReplicationProtectionIntentProviderSpecificSettings +type ReplicationProtectionIntentProviderSpecificSettingsClassification interface { + // GetReplicationProtectionIntentProviderSpecificSettings returns the ReplicationProtectionIntentProviderSpecificSettings content of the underlying type. + GetReplicationProtectionIntentProviderSpecificSettings() *ReplicationProtectionIntentProviderSpecificSettings +} + +// ReplicationProviderSpecificContainerCreationInputClassification provides polymorphic access to related types. +// Call the interface's GetReplicationProviderSpecificContainerCreationInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2AContainerCreationInput, *A2ACrossClusterMigrationContainerCreationInput, *ReplicationProviderSpecificContainerCreationInput, +// - *VMwareCbtContainerCreationInput +type ReplicationProviderSpecificContainerCreationInputClassification interface { + // GetReplicationProviderSpecificContainerCreationInput returns the ReplicationProviderSpecificContainerCreationInput content of the underlying type. + GetReplicationProviderSpecificContainerCreationInput() *ReplicationProviderSpecificContainerCreationInput +} + +// ReplicationProviderSpecificContainerMappingInputClassification provides polymorphic access to related types. +// Call the interface's GetReplicationProviderSpecificContainerMappingInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2AContainerMappingInput, *ReplicationProviderSpecificContainerMappingInput, *VMwareCbtContainerMappingInput +type ReplicationProviderSpecificContainerMappingInputClassification interface { + // GetReplicationProviderSpecificContainerMappingInput returns the ReplicationProviderSpecificContainerMappingInput content of the underlying type. + GetReplicationProviderSpecificContainerMappingInput() *ReplicationProviderSpecificContainerMappingInput +} + +// ReplicationProviderSpecificSettingsClassification provides polymorphic access to related types. +// Call the interface's GetReplicationProviderSpecificSettings() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2ACrossClusterMigrationReplicationDetails, *A2AReplicationDetails, *HyperVReplicaAzureReplicationDetails, *HyperVReplicaBaseReplicationDetails, +// - *HyperVReplicaBlueReplicationDetails, *HyperVReplicaReplicationDetails, *InMageAzureV2ReplicationDetails, *InMageRcmFailbackReplicationDetails, +// - *InMageRcmReplicationDetails, *InMageReplicationDetails, *ReplicationProviderSpecificSettings +type ReplicationProviderSpecificSettingsClassification interface { + // GetReplicationProviderSpecificSettings returns the ReplicationProviderSpecificSettings content of the underlying type. + GetReplicationProviderSpecificSettings() *ReplicationProviderSpecificSettings +} + +// ReplicationProviderSpecificUpdateContainerMappingInputClassification provides polymorphic access to related types. +// Call the interface's GetReplicationProviderSpecificUpdateContainerMappingInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2AUpdateContainerMappingInput, *InMageRcmUpdateContainerMappingInput, *ReplicationProviderSpecificUpdateContainerMappingInput +type ReplicationProviderSpecificUpdateContainerMappingInputClassification interface { + // GetReplicationProviderSpecificUpdateContainerMappingInput returns the ReplicationProviderSpecificUpdateContainerMappingInput content of the underlying type. + GetReplicationProviderSpecificUpdateContainerMappingInput() *ReplicationProviderSpecificUpdateContainerMappingInput +} + +// ResumeReplicationProviderSpecificInputClassification provides polymorphic access to related types. +// Call the interface's GetResumeReplicationProviderSpecificInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ResumeReplicationProviderSpecificInput, *VMwareCbtResumeReplicationInput +type ResumeReplicationProviderSpecificInputClassification interface { + // GetResumeReplicationProviderSpecificInput returns the ResumeReplicationProviderSpecificInput content of the underlying type. + GetResumeReplicationProviderSpecificInput() *ResumeReplicationProviderSpecificInput +} + +// ResyncProviderSpecificInputClassification provides polymorphic access to related types. +// Call the interface's GetResyncProviderSpecificInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ResyncProviderSpecificInput, *VMwareCbtResyncInput +type ResyncProviderSpecificInputClassification interface { + // GetResyncProviderSpecificInput returns the ResyncProviderSpecificInput content of the underlying type. + GetResyncProviderSpecificInput() *ResyncProviderSpecificInput +} + +// ReverseReplicationProviderSpecificInputClassification provides polymorphic access to related types. +// Call the interface's GetReverseReplicationProviderSpecificInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2AReprotectInput, *HyperVReplicaAzureReprotectInput, *InMageAzureV2ReprotectInput, *InMageRcmFailbackReprotectInput, +// - *InMageRcmReprotectInput, *InMageReprotectInput, *ReverseReplicationProviderSpecificInput +type ReverseReplicationProviderSpecificInputClassification interface { + // GetReverseReplicationProviderSpecificInput returns the ReverseReplicationProviderSpecificInput content of the underlying type. + GetReverseReplicationProviderSpecificInput() *ReverseReplicationProviderSpecificInput +} + +// StorageAccountCustomDetailsClassification provides polymorphic access to related types. +// Call the interface's GetStorageAccountCustomDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ExistingStorageAccount, *StorageAccountCustomDetails +type StorageAccountCustomDetailsClassification interface { + // GetStorageAccountCustomDetails returns the StorageAccountCustomDetails content of the underlying type. + GetStorageAccountCustomDetails() *StorageAccountCustomDetails +} + +// SwitchProtectionProviderSpecificInputClassification provides polymorphic access to related types. +// Call the interface's GetSwitchProtectionProviderSpecificInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2ASwitchProtectionInput, *SwitchProtectionProviderSpecificInput +type SwitchProtectionProviderSpecificInputClassification interface { + // GetSwitchProtectionProviderSpecificInput returns the SwitchProtectionProviderSpecificInput content of the underlying type. + GetSwitchProtectionProviderSpecificInput() *SwitchProtectionProviderSpecificInput +} + +// SwitchProviderSpecificInputClassification provides polymorphic access to related types. +// Call the interface's GetSwitchProviderSpecificInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *InMageAzureV2SwitchProviderInput, *SwitchProviderSpecificInput +type SwitchProviderSpecificInputClassification interface { + // GetSwitchProviderSpecificInput returns the SwitchProviderSpecificInput content of the underlying type. + GetSwitchProviderSpecificInput() *SwitchProviderSpecificInput +} + +// TaskTypeDetailsClassification provides polymorphic access to related types. +// Call the interface's GetTaskTypeDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AutomationRunbookTaskDetails, *ConsistencyCheckTaskDetails, *FabricReplicationGroupTaskDetails, *JobTaskDetails, *ManualActionTaskDetails, +// - *ScriptActionTaskDetails, *TaskTypeDetails, *VMNicUpdatesTaskDetails, *VirtualMachineTaskDetails +type TaskTypeDetailsClassification interface { + // GetTaskTypeDetails returns the TaskTypeDetails content of the underlying type. + GetTaskTypeDetails() *TaskTypeDetails +} + +// TestFailoverProviderSpecificInputClassification provides polymorphic access to related types. +// Call the interface's GetTestFailoverProviderSpecificInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2ATestFailoverInput, *HyperVReplicaAzureTestFailoverInput, *InMageAzureV2TestFailoverInput, *InMageRcmTestFailoverInput, +// - *InMageTestFailoverInput, *TestFailoverProviderSpecificInput +type TestFailoverProviderSpecificInputClassification interface { + // GetTestFailoverProviderSpecificInput returns the TestFailoverProviderSpecificInput content of the underlying type. + GetTestFailoverProviderSpecificInput() *TestFailoverProviderSpecificInput +} + +// TestMigrateProviderSpecificInputClassification provides polymorphic access to related types. +// Call the interface's GetTestMigrateProviderSpecificInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *TestMigrateProviderSpecificInput, *VMwareCbtTestMigrateInput +type TestMigrateProviderSpecificInputClassification interface { + // GetTestMigrateProviderSpecificInput returns the TestMigrateProviderSpecificInput content of the underlying type. + GetTestMigrateProviderSpecificInput() *TestMigrateProviderSpecificInput +} + +// UnplannedFailoverProviderSpecificInputClassification provides polymorphic access to related types. +// Call the interface's GetUnplannedFailoverProviderSpecificInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2AUnplannedFailoverInput, *HyperVReplicaAzureUnplannedFailoverInput, *InMageAzureV2UnplannedFailoverInput, *InMageRcmUnplannedFailoverInput, +// - *InMageUnplannedFailoverInput, *UnplannedFailoverProviderSpecificInput +type UnplannedFailoverProviderSpecificInputClassification interface { + // GetUnplannedFailoverProviderSpecificInput returns the UnplannedFailoverProviderSpecificInput content of the underlying type. + GetUnplannedFailoverProviderSpecificInput() *UnplannedFailoverProviderSpecificInput +} + +// UpdateApplianceForReplicationProtectedItemProviderSpecificInputClassification provides polymorphic access to related types. +// Call the interface's GetUpdateApplianceForReplicationProtectedItemProviderSpecificInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *InMageRcmUpdateApplianceForReplicationProtectedItemInput, *UpdateApplianceForReplicationProtectedItemProviderSpecificInput +type UpdateApplianceForReplicationProtectedItemProviderSpecificInputClassification interface { + // GetUpdateApplianceForReplicationProtectedItemProviderSpecificInput returns the UpdateApplianceForReplicationProtectedItemProviderSpecificInput content of the underlying type. + GetUpdateApplianceForReplicationProtectedItemProviderSpecificInput() *UpdateApplianceForReplicationProtectedItemProviderSpecificInput +} + +// UpdateMigrationItemProviderSpecificInputClassification provides polymorphic access to related types. +// Call the interface's GetUpdateMigrationItemProviderSpecificInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *UpdateMigrationItemProviderSpecificInput, *VMwareCbtUpdateMigrationItemInput +type UpdateMigrationItemProviderSpecificInputClassification interface { + // GetUpdateMigrationItemProviderSpecificInput returns the UpdateMigrationItemProviderSpecificInput content of the underlying type. + GetUpdateMigrationItemProviderSpecificInput() *UpdateMigrationItemProviderSpecificInput +} + +// UpdateReplicationProtectedItemProviderInputClassification provides polymorphic access to related types. +// Call the interface's GetUpdateReplicationProtectedItemProviderInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2AUpdateReplicationProtectedItemInput, *HyperVReplicaAzureUpdateReplicationProtectedItemInput, *InMageAzureV2UpdateReplicationProtectedItemInput, +// - *InMageRcmUpdateReplicationProtectedItemInput, *UpdateReplicationProtectedItemProviderInput +type UpdateReplicationProtectedItemProviderInputClassification interface { + // GetUpdateReplicationProtectedItemProviderInput returns the UpdateReplicationProtectedItemProviderInput content of the underlying type. + GetUpdateReplicationProtectedItemProviderInput() *UpdateReplicationProtectedItemProviderInput +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/migrationrecoverypoints_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/migrationrecoverypoints_client.go index 362608a690d0..925381d05364 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/migrationrecoverypoints_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/migrationrecoverypoints_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -47,7 +46,7 @@ func NewMigrationRecoveryPointsClient(subscriptionID string, credential azcore.T // Get - Gets a recovery point for a migration item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric unique name. @@ -57,18 +56,21 @@ func NewMigrationRecoveryPointsClient(subscriptionID string, credential azcore.T // - options - MigrationRecoveryPointsClientGetOptions contains the optional parameters for the MigrationRecoveryPointsClient.Get // method. func (client *MigrationRecoveryPointsClient) Get(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string, options *MigrationRecoveryPointsClientGetOptions) (MigrationRecoveryPointsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, migrationRecoveryPointName, options) if err != nil { return MigrationRecoveryPointsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MigrationRecoveryPointsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MigrationRecoveryPointsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MigrationRecoveryPointsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -107,7 +109,7 @@ func (client *MigrationRecoveryPointsClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -124,7 +126,7 @@ func (client *MigrationRecoveryPointsClient) getHandleResponse(resp *http.Respon // NewListByReplicationMigrationItemsPager - Gets the recovery points for a migration item. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric unique name. @@ -192,7 +194,7 @@ func (client *MigrationRecoveryPointsClient) listByReplicationMigrationItemsCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/migrationrecoverypoints_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/migrationrecoverypoints_client_example_test.go deleted file mode 100644 index d6e6910eb942..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/migrationrecoverypoints_client_example_test.go +++ /dev/null @@ -1,93 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/MigrationRecoveryPoints_ListByReplicationMigrationItems.json -func ExampleMigrationRecoveryPointsClient_NewListByReplicationMigrationItemsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMigrationRecoveryPointsClient().NewListByReplicationMigrationItemsPager("migrationvault", "resourcegroup1", "vmwarefabric1", "vmwareContainer1", "virtualmachine1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MigrationRecoveryPointCollection = armrecoveryservicessiterecovery.MigrationRecoveryPointCollection{ - // Value: []*armrecoveryservicessiterecovery.MigrationRecoveryPoint{ - // { - // Name: to.Ptr("648336ef-2d70-4d98-b100-8c299f97cd41"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationMigrationItems/migrationRecoveryPoints"), - // ID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationFabrics/vmwarefabric1/replicationProtectionContainers/vmwareContainer1/replicationMigrationItems/virtualmachine1/migrationRecoveryPoints/648336ef-2d70-4d98-b100-8c299f97cd41"), - // Properties: &armrecoveryservicessiterecovery.MigrationRecoveryPointProperties{ - // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-26T06:37:50.8082715Z"); return t}()), - // RecoveryPointType: to.Ptr(armrecoveryservicessiterecovery.MigrationRecoveryPointTypeCrashConsistent), - // }, - // }, - // { - // Name: to.Ptr("34cb2d05-e730-4d3f-b96b-a60a5e92acb2"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationMigrationItems/migrationRecoveryPoints"), - // ID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationFabrics/vmwarefabric1/replicationProtectionContainers/vmwareContainer1/replicationMigrationItems/virtualmachine1/migrationRecoveryPoints/34cb2d05-e730-4d3f-b96b-a60a5e92acb2"), - // Properties: &armrecoveryservicessiterecovery.MigrationRecoveryPointProperties{ - // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-26T07:37:30.9722019Z"); return t}()), - // RecoveryPointType: to.Ptr(armrecoveryservicessiterecovery.MigrationRecoveryPointTypeCrashConsistent), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/MigrationRecoveryPoints_Get.json -func ExampleMigrationRecoveryPointsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMigrationRecoveryPointsClient().Get(ctx, "migrationvault", "resourcegroup1", "vmwarefabric1", "vmwareContainer1", "virtualmachine1", "b22134ea-620c-474b-9fa5-3c1cb47708e3", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationRecoveryPoint = armrecoveryservicessiterecovery.MigrationRecoveryPoint{ - // Name: to.Ptr("b22134ea-620c-474b-9fa5-3c1cb47708e3"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationMigrationItems/migrationRecoveryPoints"), - // ID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationFabrics/vmwarefabric1/replicationProtectionContainers/vmwareContainer1/replicationMigrationItems/virtualmachine1/migrationRecoveryPoints/b22134ea-620c-474b-9fa5-3c1cb47708e3"), - // Properties: &armrecoveryservicessiterecovery.MigrationRecoveryPointProperties{ - // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-26T06:37:50.8082715Z"); return t}()), - // RecoveryPointType: to.Ptr(armrecoveryservicessiterecovery.MigrationRecoveryPointTypeCrashConsistent), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/models.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/models.go index 4dca59e995bc..fb46564b57a4 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/models.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/models.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -364,6 +363,45 @@ type A2AExtendedLocationDetails struct { RecoveryExtendedLocation *ExtendedLocation } +// A2AFabricSpecificLocationDetails - ExtendedLocation details data. +type A2AFabricSpecificLocationDetails struct { + // The initial primary ExtendedLocation. + InitialPrimaryExtendedLocation *ExtendedLocation + + // Initial primary fabric location info. + InitialPrimaryFabricLocation *string + + // The initial source zone info. + InitialPrimaryZone *string + + // The initial recovery ExtendedLocation. + InitialRecoveryExtendedLocation *ExtendedLocation + + // The initial recovery fabric location info. + InitialRecoveryFabricLocation *string + + // The initial target zone info. + InitialRecoveryZone *string + + // The primary ExtendedLocation. + PrimaryExtendedLocation *ExtendedLocation + + // Primary fabric location info. + PrimaryFabricLocation *string + + // Source zone info. + PrimaryZone *string + + // The recovery ExtendedLocation. + RecoveryExtendedLocation *ExtendedLocation + + // The recovery fabric location info. + RecoveryFabricLocation *string + + // The target zone info. + RecoveryZone *string +} + // A2APolicyCreationInput - A2A Policy creation input. type A2APolicyCreationInput struct { // REQUIRED; The class type. @@ -828,6 +866,9 @@ type A2AReplicationDetails struct { // READ-ONLY; Agent certificate expiry date. AgentCertificateExpiryDate *time.Time + // READ-ONLY; A value indicating the churn option selected by user. + ChurnOptionSelected *ChurnOptionSelected + // READ-ONLY; The initial primary fabric location. InitialPrimaryFabricLocation *string @@ -1255,15 +1296,6 @@ type AddDisksInputProperties struct { ProviderSpecificDetails AddDisksProviderSpecificInputClassification } -// AddDisksProviderSpecificInputClassification provides polymorphic access to related types. -// Call the interface's GetAddDisksProviderSpecificInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *A2AAddDisksInput, *AddDisksProviderSpecificInput -type AddDisksProviderSpecificInputClassification interface { - // GetAddDisksProviderSpecificInput returns the AddDisksProviderSpecificInput content of the underlying type. - GetAddDisksProviderSpecificInput() *AddDisksProviderSpecificInput -} - // AddDisksProviderSpecificInput - Add Disks provider specific input. type AddDisksProviderSpecificInput struct { // REQUIRED; The class type. @@ -1410,19 +1442,46 @@ type ApplianceCollection struct { Value []*ReplicationAppliance } +// ApplianceMonitoringDetails - Appliance details of the migration item. +type ApplianceMonitoringDetails struct { + // READ-ONLY; The appliance CPU details. + CPUDetails *ApplianceResourceDetails + + // READ-ONLY; The appliance datastore snapshot details. + DatastoreSnapshot []*DataStoreUtilizationDetails + + // READ-ONLY; The disk replication details. + DisksReplicationDetails *ApplianceResourceDetails + + // READ-ONLY; The ESXi NFC buffer details. + EsxiNfcBuffer *ApplianceResourceDetails + + // READ-ONLY; The appliance network bandwidth details. + NetworkBandwidth *ApplianceResourceDetails + + // READ-ONLY; The appliance RAM details. + RAMDetails *ApplianceResourceDetails +} + // ApplianceQueryParameter - Query parameter to get appliance. type ApplianceQueryParameter struct { // The providerType to be used for fetching appliance details. ProviderType *string } -// ApplianceSpecificDetailsClassification provides polymorphic access to related types. -// Call the interface's GetApplianceSpecificDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ApplianceSpecificDetails, *InMageRcmApplianceSpecificDetails -type ApplianceSpecificDetailsClassification interface { - // GetApplianceSpecificDetails returns the ApplianceSpecificDetails content of the underlying type. - GetApplianceSpecificDetails() *ApplianceSpecificDetails +// ApplianceResourceDetails - Details of the appliance resource. +type ApplianceResourceDetails struct { + // READ-ONLY; A value indicating the total capacity of appliance resource. + Capacity *int64 + + // READ-ONLY; A value indicating the utilization percentage by gateway agent on appliance. + ProcessUtilization *float64 + + // READ-ONLY; A value indicating the status of appliance resource. + Status *string + + // READ-ONLY; A value indicating the total utilization percentage for all processes on the appliance. + TotalUtilization *float64 } // ApplianceSpecificDetails - Appliance specific details. @@ -1449,16 +1508,6 @@ type ApplyRecoveryPointInputProperties struct { RecoveryPointID *string } -// ApplyRecoveryPointProviderSpecificInputClassification provides polymorphic access to related types. -// Call the interface's GetApplyRecoveryPointProviderSpecificInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *A2AApplyRecoveryPointInput, *A2ACrossClusterMigrationApplyRecoveryPointInput, *ApplyRecoveryPointProviderSpecificInput, -// - *HyperVReplicaAzureApplyRecoveryPointInput, *InMageAzureV2ApplyRecoveryPointInput, *InMageRcmApplyRecoveryPointInput -type ApplyRecoveryPointProviderSpecificInputClassification interface { - // GetApplyRecoveryPointProviderSpecificInput returns the ApplyRecoveryPointProviderSpecificInput content of the underlying type. - GetApplyRecoveryPointProviderSpecificInput() *ApplyRecoveryPointProviderSpecificInput -} - // ApplyRecoveryPointProviderSpecificInput - Provider specific input for apply recovery point. type ApplyRecoveryPointProviderSpecificInput struct { // REQUIRED; The class type. @@ -1484,8 +1533,8 @@ type AsrJobDetails struct { // GetJobDetails implements the JobDetailsClassification interface for type AsrJobDetails. func (a *AsrJobDetails) GetJobDetails() *JobDetails { return &JobDetails{ - InstanceType: a.InstanceType, AffectedObjectDetails: a.AffectedObjectDetails, + InstanceType: a.InstanceType, } } @@ -1559,6 +1608,9 @@ type AzureFabricSpecificDetails struct { // The Location for the Azure fabric. Location *string + // The location details. + LocationDetails []*A2AFabricSpecificLocationDetails + // The zones. Zones []*A2AZoneDetails } @@ -1676,15 +1728,6 @@ type ComputeSizeErrorDetails struct { Severity *string } -// ConfigurationSettingsClassification provides polymorphic access to related types. -// Call the interface's GetConfigurationSettings() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ConfigurationSettings, *HyperVVirtualMachineDetails, *ReplicationGroupDetails, *VMwareVirtualMachineDetails, *VmmVirtualMachineDetails -type ConfigurationSettingsClassification interface { - // GetConfigurationSettings returns the ConfigurationSettings content of the underlying type. - GetConfigurationSettings() *ConfigurationSettings -} - // ConfigurationSettings - Replication provider specific settings. type ConfigurationSettings struct { // REQUIRED; Gets the class type. Overridden in derived classes. @@ -1800,15 +1843,6 @@ type CreateProtectionIntentProperties struct { ProviderSpecificDetails CreateProtectionIntentProviderSpecificDetailsClassification } -// CreateProtectionIntentProviderSpecificDetailsClassification provides polymorphic access to related types. -// Call the interface's GetCreateProtectionIntentProviderSpecificDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *A2ACreateProtectionIntentInput, *CreateProtectionIntentProviderSpecificDetails -type CreateProtectionIntentProviderSpecificDetailsClassification interface { - // GetCreateProtectionIntentProviderSpecificDetails returns the CreateProtectionIntentProviderSpecificDetails content of the underlying type. - GetCreateProtectionIntentProviderSpecificDetails() *CreateProtectionIntentProviderSpecificDetails -} - // CreateProtectionIntentProviderSpecificDetails - Create protection intent provider specific input. type CreateProtectionIntentProviderSpecificDetails struct { // REQUIRED; The class type. @@ -1902,6 +1936,18 @@ type DataStore struct { UUID *string } +// DataStoreUtilizationDetails - Details of the appliance resource. +type DataStoreUtilizationDetails struct { + // READ-ONLY; The datastore name. + DataStoreName *string + + // READ-ONLY; The total snapshots created for server migration in the datastore. + TotalSnapshotsCreated *int64 + + // READ-ONLY; The total count of snapshots supported by the datastore. + TotalSnapshotsSupported *int64 +} + // DisableProtectionInput - Disable protection input. type DisableProtectionInput struct { // REQUIRED; Disable protection input properties. @@ -1917,15 +1963,6 @@ type DisableProtectionInputProperties struct { ReplicationProviderInput DisableProtectionProviderSpecificInputClassification } -// DisableProtectionProviderSpecificInputClassification provides polymorphic access to related types. -// Call the interface's GetDisableProtectionProviderSpecificInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *DisableProtectionProviderSpecificInput, *InMageDisableProtectionProviderSpecificInput -type DisableProtectionProviderSpecificInputClassification interface { - // GetDisableProtectionProviderSpecificInput returns the DisableProtectionProviderSpecificInput content of the underlying type. - GetDisableProtectionProviderSpecificInput() *DisableProtectionProviderSpecificInput -} - // DisableProtectionProviderSpecificInput - Disable protection provider specific input. type DisableProtectionProviderSpecificInput struct { // REQUIRED; The class type. @@ -2074,15 +2111,6 @@ type EnableMigrationInputProperties struct { ProviderSpecificDetails EnableMigrationProviderSpecificInputClassification } -// EnableMigrationProviderSpecificInputClassification provides polymorphic access to related types. -// Call the interface's GetEnableMigrationProviderSpecificInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *EnableMigrationProviderSpecificInput, *VMwareCbtEnableMigrationInput -type EnableMigrationProviderSpecificInputClassification interface { - // GetEnableMigrationProviderSpecificInput returns the EnableMigrationProviderSpecificInput content of the underlying type. - GetEnableMigrationProviderSpecificInput() *EnableMigrationProviderSpecificInput -} - // EnableMigrationProviderSpecificInput - Enable migration provider specific input. type EnableMigrationProviderSpecificInput struct { // REQUIRED; The class type. @@ -2115,16 +2143,6 @@ type EnableProtectionInputProperties struct { ProviderSpecificDetails EnableProtectionProviderSpecificInputClassification } -// EnableProtectionProviderSpecificInputClassification provides polymorphic access to related types. -// Call the interface's GetEnableProtectionProviderSpecificInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *A2ACrossClusterMigrationEnableProtectionInput, *A2AEnableProtectionInput, *EnableProtectionProviderSpecificInput, *HyperVReplicaAzureEnableProtectionInput, -// - *InMageAzureV2EnableProtectionInput, *InMageEnableProtectionInput, *InMageRcmEnableProtectionInput -type EnableProtectionProviderSpecificInputClassification interface { - // GetEnableProtectionProviderSpecificInput returns the EnableProtectionProviderSpecificInput content of the underlying type. - GetEnableProtectionProviderSpecificInput() *EnableProtectionProviderSpecificInput -} - // EnableProtectionProviderSpecificInput - Enable protection provider specific input. type EnableProtectionProviderSpecificInput struct { // REQUIRED; The class type. @@ -2212,16 +2230,6 @@ type EventProperties struct { TimeOfOccurrence *time.Time } -// EventProviderSpecificDetailsClassification provides polymorphic access to related types. -// Call the interface's GetEventProviderSpecificDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *A2AEventDetails, *EventProviderSpecificDetails, *HyperVReplica2012EventDetails, *HyperVReplica2012R2EventDetails, *HyperVReplicaAzureEventDetails, -// - *HyperVReplicaBaseEventDetails, *InMageAzureV2EventDetails, *InMageRcmEventDetails, *InMageRcmFailbackEventDetails, *VMwareCbtEventDetails -type EventProviderSpecificDetailsClassification interface { - // GetEventProviderSpecificDetails returns the EventProviderSpecificDetails content of the underlying type. - GetEventProviderSpecificDetails() *EventProviderSpecificDetails -} - // EventProviderSpecificDetails - Model class for provider specific details for an event. type EventProviderSpecificDetails struct { // REQUIRED; Gets the class type. Overridden in derived classes. @@ -2260,15 +2268,6 @@ type EventQueryParameter struct { StartTime *time.Time } -// EventSpecificDetailsClassification provides polymorphic access to related types. -// Call the interface's GetEventSpecificDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *EventSpecificDetails, *JobStatusEventDetails -type EventSpecificDetailsClassification interface { - // GetEventSpecificDetails returns the EventSpecificDetails content of the underlying type. - GetEventSpecificDetails() *EventSpecificDetails -} - // EventSpecificDetails - Model class for event specific details for an event. type EventSpecificDetails struct { // REQUIRED; Gets the class type. Overridden in derived classes. @@ -2400,8 +2399,8 @@ type ExportJobDetails struct { // GetJobDetails implements the JobDetailsClassification interface for type ExportJobDetails. func (e *ExportJobDetails) GetJobDetails() *JobDetails { return &JobDetails{ - InstanceType: e.InstanceType, AffectedObjectDetails: e.AffectedObjectDetails, + InstanceType: e.InstanceType, } } @@ -2488,12 +2487,18 @@ type FabricQueryParameter struct { // The type of the discovered machine to be used for fetching agent details. DiscoveryType *string + // A value indicating whether the Extended Location mappings are to be returned. + ExtendedLocationMappings *string + // A value indicating whether the agent details are to be fetched. FetchAgentDetails *string // The FQDN to be used for fetching agent details. Fqdn *string + // A value indicating whether the location details are to be returned. + LocationDetails *string + // The OS type to be used for fetching agent details. OSType *string @@ -2519,8 +2524,8 @@ type FabricReplicationGroupTaskDetails struct { // GetJobTaskDetails implements the JobTaskDetailsClassification interface for type FabricReplicationGroupTaskDetails. func (f *FabricReplicationGroupTaskDetails) GetJobTaskDetails() *JobTaskDetails { return &JobTaskDetails{ - JobTask: f.JobTask, InstanceType: f.InstanceType, + JobTask: f.JobTask, } } @@ -2531,16 +2536,6 @@ func (f *FabricReplicationGroupTaskDetails) GetTaskTypeDetails() *TaskTypeDetail } } -// FabricSpecificCreateNetworkMappingInputClassification provides polymorphic access to related types. -// Call the interface's GetFabricSpecificCreateNetworkMappingInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureToAzureCreateNetworkMappingInput, *FabricSpecificCreateNetworkMappingInput, *VmmToAzureCreateNetworkMappingInput, -// - *VmmToVmmCreateNetworkMappingInput -type FabricSpecificCreateNetworkMappingInputClassification interface { - // GetFabricSpecificCreateNetworkMappingInput returns the FabricSpecificCreateNetworkMappingInput content of the underlying type. - GetFabricSpecificCreateNetworkMappingInput() *FabricSpecificCreateNetworkMappingInput -} - // FabricSpecificCreateNetworkMappingInput - Input details specific to fabrics during Network Mapping. type FabricSpecificCreateNetworkMappingInput struct { // REQUIRED; The instance type. @@ -2553,15 +2548,6 @@ func (f *FabricSpecificCreateNetworkMappingInput) GetFabricSpecificCreateNetwork return f } -// FabricSpecificCreationInputClassification provides polymorphic access to related types. -// Call the interface's GetFabricSpecificCreationInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureFabricCreationInput, *FabricSpecificCreationInput, *InMageRcmFabricCreationInput, *VMwareV2FabricCreationInput -type FabricSpecificCreationInputClassification interface { - // GetFabricSpecificCreationInput returns the FabricSpecificCreationInput content of the underlying type. - GetFabricSpecificCreationInput() *FabricSpecificCreationInput -} - // FabricSpecificCreationInput - Fabric provider specific settings. type FabricSpecificCreationInput struct { // REQUIRED; Gets the class type. @@ -2573,16 +2559,6 @@ func (f *FabricSpecificCreationInput) GetFabricSpecificCreationInput() *FabricSp return f } -// FabricSpecificDetailsClassification provides polymorphic access to related types. -// Call the interface's GetFabricSpecificDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureFabricSpecificDetails, *FabricSpecificDetails, *HyperVSiteDetails, *InMageRcmFabricSpecificDetails, *VMwareDetails, -// - *VMwareV2FabricSpecificDetails, *VmmDetails -type FabricSpecificDetailsClassification interface { - // GetFabricSpecificDetails returns the FabricSpecificDetails content of the underlying type. - GetFabricSpecificDetails() *FabricSpecificDetails -} - // FabricSpecificDetails - Fabric specific details. type FabricSpecificDetails struct { // REQUIRED; Gets the class type. Overridden in derived classes. @@ -2592,16 +2568,6 @@ type FabricSpecificDetails struct { // GetFabricSpecificDetails implements the FabricSpecificDetailsClassification interface for type FabricSpecificDetails. func (f *FabricSpecificDetails) GetFabricSpecificDetails() *FabricSpecificDetails { return f } -// FabricSpecificUpdateNetworkMappingInputClassification provides polymorphic access to related types. -// Call the interface's GetFabricSpecificUpdateNetworkMappingInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureToAzureUpdateNetworkMappingInput, *FabricSpecificUpdateNetworkMappingInput, *VmmToAzureUpdateNetworkMappingInput, -// - *VmmToVmmUpdateNetworkMappingInput -type FabricSpecificUpdateNetworkMappingInputClassification interface { - // GetFabricSpecificUpdateNetworkMappingInput returns the FabricSpecificUpdateNetworkMappingInput content of the underlying type. - GetFabricSpecificUpdateNetworkMappingInput() *FabricSpecificUpdateNetworkMappingInput -} - // FabricSpecificUpdateNetworkMappingInput - Input details specific to fabrics during Network Mapping. type FabricSpecificUpdateNetworkMappingInput struct { // REQUIRED; The instance type. @@ -2630,8 +2596,8 @@ type FailoverJobDetails struct { // GetJobDetails implements the JobDetailsClassification interface for type FailoverJobDetails. func (f *FailoverJobDetails) GetJobDetails() *JobDetails { return &JobDetails{ - InstanceType: f.InstanceType, AffectedObjectDetails: f.AffectedObjectDetails, + InstanceType: f.InstanceType, } } @@ -2689,13 +2655,31 @@ type FailoverReplicationProtectedItemDetails struct { TestVMName *string } -// GroupTaskDetailsClassification provides polymorphic access to related types. -// Call the interface's GetGroupTaskDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *GroupTaskDetails, *InlineWorkflowTaskDetails, *RecoveryPlanGroupTaskDetails, *RecoveryPlanShutdownGroupTaskDetails -type GroupTaskDetailsClassification interface { - // GetGroupTaskDetails returns the GroupTaskDetails content of the underlying type. - GetGroupTaskDetails() *GroupTaskDetails +// GatewayOperationDetails - Details of the gateway operation. +type GatewayOperationDetails struct { + // READ-ONLY; A value indicating the datastore collection. + DataStores []*string + + // READ-ONLY; A value indicating the ESXi host name. + HostName *string + + // READ-ONLY; A value indicating the progress percentage of gateway operation. + ProgressPercentage *int32 + + // READ-ONLY; A value indicating the state of gateway operation. + State *string + + // READ-ONLY; A value indicating the time elapsed for the operation in milliseconds. + TimeElapsed *int64 + + // READ-ONLY; A value indicating the time remaining for the operation in milliseconds. + TimeRemaining *int64 + + // READ-ONLY; A value indicating the upload speed in bytes per second. + UploadSpeed *int64 + + // READ-ONLY; A value indicating the VMware read throughput in bytes per second. + VmwareReadThroughput *int64 } // GroupTaskDetails - This class represents the group task details when parent child relationship exists in the drill down. @@ -3048,6 +3032,9 @@ type HyperVReplicaAzurePlannedFailoverProviderInput struct { // REQUIRED; The class type. InstanceType *string + // A value indicating the inplace OS Upgrade version. + OSUpgradeVersion *string + // Primary kek certificate pfx. PrimaryKekCertificatePfx *string @@ -3131,6 +3118,9 @@ type HyperVReplicaAzureReplicationDetails struct { // REQUIRED; Gets the Instance type. InstanceType *string + // A value indicating all available inplace OS Upgrade configurations. + AllAvailableOSUpgradeConfigurations []*OSUpgradeSupportedVersions + // Azure VM Disk details. AzureVMDiskDetails []*AzureVMDiskDetails @@ -3278,6 +3268,9 @@ type HyperVReplicaAzureTestFailoverInput struct { // REQUIRED; The class type. InstanceType *string + // A value indicating the inplace OS Upgrade version. + OSUpgradeVersion *string + // Primary kek certificate pfx. PrimaryKekCertificatePfx *string @@ -3559,17 +3552,17 @@ type HyperVReplicaBluePolicyInput struct { // GetHyperVReplicaPolicyInput implements the HyperVReplicaPolicyInputClassification interface for type HyperVReplicaBluePolicyInput. func (h *HyperVReplicaBluePolicyInput) GetHyperVReplicaPolicyInput() *HyperVReplicaPolicyInput { return &HyperVReplicaPolicyInput{ - RecoveryPoints: h.RecoveryPoints, + AllowedAuthenticationType: h.AllowedAuthenticationType, ApplicationConsistentSnapshotFrequencyInHours: h.ApplicationConsistentSnapshotFrequencyInHours, Compression: h.Compression, InitialReplicationMethod: h.InitialReplicationMethod, - OnlineReplicationStartTime: h.OnlineReplicationStartTime, - OfflineReplicationImportPath: h.OfflineReplicationImportPath, + InstanceType: h.InstanceType, OfflineReplicationExportPath: h.OfflineReplicationExportPath, - ReplicationPort: h.ReplicationPort, - AllowedAuthenticationType: h.AllowedAuthenticationType, + OfflineReplicationImportPath: h.OfflineReplicationImportPath, + OnlineReplicationStartTime: h.OnlineReplicationStartTime, + RecoveryPoints: h.RecoveryPoints, ReplicaDeletion: h.ReplicaDeletion, - InstanceType: h.InstanceType, + ReplicationPort: h.ReplicationPort, } } @@ -3658,16 +3651,6 @@ func (h *HyperVReplicaPolicyDetails) GetPolicyProviderSpecificDetails() *PolicyP } } -// HyperVReplicaPolicyInputClassification provides polymorphic access to related types. -// Call the interface's GetHyperVReplicaPolicyInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *HyperVReplicaBluePolicyInput, *HyperVReplicaPolicyInput -type HyperVReplicaPolicyInputClassification interface { - PolicyProviderSpecificInputClassification - // GetHyperVReplicaPolicyInput returns the HyperVReplicaPolicyInput content of the underlying type. - GetHyperVReplicaPolicyInput() *HyperVReplicaPolicyInput -} - // HyperVReplicaPolicyInput - Hyper-V Replica specific policy Input. type HyperVReplicaPolicyInput struct { // REQUIRED; The class type. @@ -3765,16 +3748,6 @@ func (h *HyperVSiteDetails) GetFabricSpecificDetails() *FabricSpecificDetails { } } -// HyperVVirtualMachineDetailsClassification provides polymorphic access to related types. -// Call the interface's GetHyperVVirtualMachineDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *HyperVVirtualMachineDetails, *VmmVirtualMachineDetails -type HyperVVirtualMachineDetailsClassification interface { - ConfigurationSettingsClassification - // GetHyperVVirtualMachineDetails returns the HyperVVirtualMachineDetails content of the underlying type. - GetHyperVVirtualMachineDetails() *HyperVVirtualMachineDetails -} - // HyperVVirtualMachineDetails - Single Host fabric provider specific VM settings. type HyperVVirtualMachineDetails struct { // REQUIRED; Gets the class type. Overridden in derived classes. @@ -4239,6 +4212,9 @@ type InMageAzureV2ReplicationDetails struct { // The agent version. AgentVersion *string + // A value indicating all available inplace OS Upgrade configurations. + AllAvailableOSUpgradeConfigurations []*OSUpgradeSupportedVersions + // Azure VM Disk details. AzureVMDiskDetails []*AzureVMDiskDetails @@ -4376,6 +4352,9 @@ type InMageAzureV2ReplicationDetails struct { // The RAM size of the VM on the primary side. SourceVMRAMSizeInMB *int32 + // A value indicating the inplace OS Upgrade version. + SupportedOSVersions []*string + // The switch provider blocking error information. SwitchProviderBlockingErrorDetails []*InMageAzureV2SwitchProviderBlockingErrorDetails @@ -4436,6 +4415,9 @@ type InMageAzureV2ReplicationDetails struct { // READ-ONLY; The last recovery point received time. LastRecoveryPointReceived *time.Time + + // READ-ONLY; The name of the OS on the VM. + OSName *string } // GetReplicationProviderSpecificSettings implements the ReplicationProviderSpecificSettingsClassification interface for type @@ -4544,6 +4526,9 @@ type InMageAzureV2TestFailoverInput struct { // REQUIRED; The class type. InstanceType *string + // A value indicating the inplace OS Upgrade version. + OSUpgradeVersion *string + // The recovery point id to be passed to test failover to a particular recovery point. In case of latest recovery point, null // should be passed. RecoveryPointID *string @@ -4562,6 +4547,9 @@ type InMageAzureV2UnplannedFailoverInput struct { // REQUIRED; The class type. InstanceType *string + // A value indicating the inplace OS Upgrade version. + OSUpgradeVersion *string + // The recovery point id to be passed to failover to a particular recovery point. In case of latest recovery point, null should // be passed. RecoveryPointID *string @@ -6478,8 +6466,8 @@ type InlineWorkflowTaskDetails struct { // GetGroupTaskDetails implements the GroupTaskDetailsClassification interface for type InlineWorkflowTaskDetails. func (i *InlineWorkflowTaskDetails) GetGroupTaskDetails() *GroupTaskDetails { return &GroupTaskDetails{ - InstanceType: i.InstanceType, ChildTasks: i.ChildTasks, + InstanceType: i.InstanceType, } } @@ -6565,15 +6553,6 @@ type JobCollection struct { Value []*Job } -// JobDetailsClassification provides polymorphic access to related types. -// Call the interface's GetJobDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AsrJobDetails, *ExportJobDetails, *FailoverJobDetails, *JobDetails, *SwitchProtectionJobDetails, *TestFailoverJobDetails -type JobDetailsClassification interface { - // GetJobDetails returns the JobDetails content of the underlying type. - GetJobDetails() *JobDetails -} - // JobDetails - Job details based on specific job type. type JobDetails struct { // REQUIRED; Gets the type of job details (see JobDetailsTypes enum for possible values). @@ -6724,16 +6703,6 @@ func (j *JobStatusEventDetails) GetEventSpecificDetails() *EventSpecificDetails } } -// JobTaskDetailsClassification provides polymorphic access to related types. -// Call the interface's GetJobTaskDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *FabricReplicationGroupTaskDetails, *JobTaskDetails, *VirtualMachineTaskDetails -type JobTaskDetailsClassification interface { - TaskTypeDetailsClassification - // GetJobTaskDetails returns the JobTaskDetails content of the underlying type. - GetJobTaskDetails() *JobTaskDetails -} - // JobTaskDetails - This class represents a task which is actually a workflow so that one can navigate to its individual drill // down. type JobTaskDetails struct { @@ -6926,15 +6895,6 @@ type MigrateInputProperties struct { ProviderSpecificDetails MigrateProviderSpecificInputClassification } -// MigrateProviderSpecificInputClassification provides polymorphic access to related types. -// Call the interface's GetMigrateProviderSpecificInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *MigrateProviderSpecificInput, *VMwareCbtMigrateInput -type MigrateProviderSpecificInputClassification interface { - // GetMigrateProviderSpecificInput returns the MigrateProviderSpecificInput content of the underlying type. - GetMigrateProviderSpecificInput() *MigrateProviderSpecificInput -} - // MigrateProviderSpecificInput - Migrate provider specific input. type MigrateProviderSpecificInput struct { // REQUIRED; The class type. @@ -7048,15 +7008,6 @@ type MigrationItemsQueryParameter struct { SourceFabricName *string } -// MigrationProviderSpecificSettingsClassification provides polymorphic access to related types. -// Call the interface's GetMigrationProviderSpecificSettings() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *MigrationProviderSpecificSettings, *VMwareCbtMigrationDetails -type MigrationProviderSpecificSettingsClassification interface { - // GetMigrationProviderSpecificSettings returns the MigrationProviderSpecificSettings content of the underlying type. - GetMigrationProviderSpecificSettings() *MigrationProviderSpecificSettings -} - // MigrationProviderSpecificSettings - Migration provider specific settings. type MigrationProviderSpecificSettings struct { // REQUIRED; Gets the instance type. @@ -7105,17 +7056,6 @@ type MigrationRecoveryPointProperties struct { RecoveryPointType *MigrationRecoveryPointType } -// MigrationRecoveryPointsClientGetOptions contains the optional parameters for the MigrationRecoveryPointsClient.Get method. -type MigrationRecoveryPointsClientGetOptions struct { - // placeholder for future optional parameters -} - -// MigrationRecoveryPointsClientListByReplicationMigrationItemsOptions contains the optional parameters for the MigrationRecoveryPointsClient.NewListByReplicationMigrationItemsPager -// method. -type MigrationRecoveryPointsClientListByReplicationMigrationItemsOptions struct { - // placeholder for future optional parameters -} - // MobilityServiceUpdate - The Mobility Service update details. type MobilityServiceUpdate struct { // The OS type. @@ -7188,15 +7128,6 @@ type NetworkMappingCollection struct { Value []*NetworkMapping } -// NetworkMappingFabricSpecificSettingsClassification provides polymorphic access to related types. -// Call the interface's GetNetworkMappingFabricSpecificSettings() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureToAzureNetworkMappingSettings, *NetworkMappingFabricSpecificSettings, *VmmToAzureNetworkMappingSettings, *VmmToVmmNetworkMappingSettings -type NetworkMappingFabricSpecificSettingsClassification interface { - // GetNetworkMappingFabricSpecificSettings returns the NetworkMappingFabricSpecificSettings content of the underlying type. - GetNetworkMappingFabricSpecificSettings() *NetworkMappingFabricSpecificSettings -} - // NetworkMappingFabricSpecificSettings - Network Mapping fabric specific settings. type NetworkMappingFabricSpecificSettings struct { // REQUIRED; Gets the Instance type. @@ -7336,6 +7267,15 @@ type OSDiskDetails struct { VhdName *string } +// OSUpgradeSupportedVersions - Supported OS upgrade versions. +type OSUpgradeSupportedVersions struct { + // READ-ONLY; The source OS version name. + SupportedSourceOsVersion *string + + // READ-ONLY; The target OS version names. + SupportedTargetOsVersions []*string +} + // OSVersionWrapper - Wrapper model for OSVersion to include version and service pack info. type OSVersionWrapper struct { // The service pack. @@ -7345,11 +7285,6 @@ type OSVersionWrapper struct { Version *string } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - // OperationsDiscovery - Operations discovery class. type OperationsDiscovery struct { // Object type. @@ -7414,16 +7349,6 @@ type PlannedFailoverInputProperties struct { ProviderSpecificDetails PlannedFailoverProviderSpecificFailoverInputClassification } -// PlannedFailoverProviderSpecificFailoverInputClassification provides polymorphic access to related types. -// Call the interface's GetPlannedFailoverProviderSpecificFailoverInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *HyperVReplicaAzureFailbackProviderInput, *HyperVReplicaAzurePlannedFailoverProviderInput, *InMageRcmFailbackPlannedFailoverProviderInput, -// - *PlannedFailoverProviderSpecificFailoverInput -type PlannedFailoverProviderSpecificFailoverInputClassification interface { - // GetPlannedFailoverProviderSpecificFailoverInput returns the PlannedFailoverProviderSpecificFailoverInput content of the underlying type. - GetPlannedFailoverProviderSpecificFailoverInput() *PlannedFailoverProviderSpecificFailoverInput -} - // PlannedFailoverProviderSpecificFailoverInput - Provider specific failover input. type PlannedFailoverProviderSpecificFailoverInput struct { // REQUIRED; The class type. @@ -7472,17 +7397,6 @@ type PolicyProperties struct { ProviderSpecificDetails PolicyProviderSpecificDetailsClassification } -// PolicyProviderSpecificDetailsClassification provides polymorphic access to related types. -// Call the interface's GetPolicyProviderSpecificDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *A2APolicyDetails, *HyperVReplicaAzurePolicyDetails, *HyperVReplicaBasePolicyDetails, *HyperVReplicaBluePolicyDetails, -// - *HyperVReplicaPolicyDetails, *InMageAzureV2PolicyDetails, *InMageBasePolicyDetails, *InMagePolicyDetails, *InMageRcmFailbackPolicyDetails, -// - *InMageRcmPolicyDetails, *PolicyProviderSpecificDetails, *VmwareCbtPolicyDetails -type PolicyProviderSpecificDetailsClassification interface { - // GetPolicyProviderSpecificDetails returns the PolicyProviderSpecificDetails content of the underlying type. - GetPolicyProviderSpecificDetails() *PolicyProviderSpecificDetails -} - // PolicyProviderSpecificDetails - Base class for Provider specific details for policies. type PolicyProviderSpecificDetails struct { // REQUIRED; Gets the class type. Overridden in derived classes. @@ -7494,17 +7408,6 @@ func (p *PolicyProviderSpecificDetails) GetPolicyProviderSpecificDetails() *Poli return p } -// PolicyProviderSpecificInputClassification provides polymorphic access to related types. -// Call the interface's GetPolicyProviderSpecificInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *A2ACrossClusterMigrationPolicyCreationInput, *A2APolicyCreationInput, *HyperVReplicaAzurePolicyInput, *HyperVReplicaBluePolicyInput, -// - *HyperVReplicaPolicyInput, *InMageAzureV2PolicyInput, *InMagePolicyInput, *InMageRcmFailbackPolicyCreationInput, *InMageRcmPolicyCreationInput, -// - *PolicyProviderSpecificInput, *VMwareCbtPolicyCreationInput -type PolicyProviderSpecificInputClassification interface { - // GetPolicyProviderSpecificInput returns the PolicyProviderSpecificInput content of the underlying type. - GetPolicyProviderSpecificInput() *PolicyProviderSpecificInput -} - // PolicyProviderSpecificInput - Base class for provider specific input. type PolicyProviderSpecificInput struct { // REQUIRED; The class type. @@ -7897,16 +7800,6 @@ type ProtectionContainerMappingProperties struct { TargetProtectionContainerID *string } -// ProtectionContainerMappingProviderSpecificDetailsClassification provides polymorphic access to related types. -// Call the interface's GetProtectionContainerMappingProviderSpecificDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *A2AProtectionContainerMappingDetails, *InMageRcmProtectionContainerMappingDetails, *ProtectionContainerMappingProviderSpecificDetails, -// - *VMwareCbtProtectionContainerMappingDetails -type ProtectionContainerMappingProviderSpecificDetailsClassification interface { - // GetProtectionContainerMappingProviderSpecificDetails returns the ProtectionContainerMappingProviderSpecificDetails content of the underlying type. - GetProtectionContainerMappingProviderSpecificDetails() *ProtectionContainerMappingProviderSpecificDetails -} - // ProtectionContainerMappingProviderSpecificDetails - Container mapping provider specific details. type ProtectionContainerMappingProviderSpecificDetails struct { // REQUIRED; Gets the class type. Overridden in derived classes. @@ -7943,15 +7836,6 @@ type ProtectionContainerProperties struct { Role *string } -// ProtectionProfileCustomDetailsClassification provides polymorphic access to related types. -// Call the interface's GetProtectionProfileCustomDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ExistingProtectionProfile, *NewProtectionProfile, *ProtectionProfileCustomDetails -type ProtectionProfileCustomDetailsClassification interface { - // GetProtectionProfileCustomDetails returns the ProtectionProfileCustomDetails content of the underlying type. - GetProtectionProfileCustomDetails() *ProtectionProfileCustomDetails -} - // ProtectionProfileCustomDetails - Protection Profile custom input. type ProtectionProfileCustomDetails struct { // REQUIRED; The class type. @@ -7981,15 +7865,6 @@ type ProviderError struct { RecommendedAction *string } -// ProviderSpecificRecoveryPointDetailsClassification provides polymorphic access to related types. -// Call the interface's GetProviderSpecificRecoveryPointDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *A2ARecoveryPointDetails, *InMageAzureV2RecoveryPointDetails, *InMageRcmRecoveryPointDetails, *ProviderSpecificRecoveryPointDetails -type ProviderSpecificRecoveryPointDetailsClassification interface { - // GetProviderSpecificRecoveryPointDetails returns the ProviderSpecificRecoveryPointDetails content of the underlying type. - GetProviderSpecificRecoveryPointDetails() *ProviderSpecificRecoveryPointDetails -} - // ProviderSpecificRecoveryPointDetails - Replication provider specific recovery point details. type ProviderSpecificRecoveryPointDetails struct { // REQUIRED; Gets the provider type. @@ -8065,15 +7940,6 @@ type RcmProxyDetails struct { Version *string } -// RecoveryAvailabilitySetCustomDetailsClassification provides polymorphic access to related types. -// Call the interface's GetRecoveryAvailabilitySetCustomDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ExistingRecoveryAvailabilitySet, *RecoveryAvailabilitySetCustomDetails -type RecoveryAvailabilitySetCustomDetailsClassification interface { - // GetRecoveryAvailabilitySetCustomDetails returns the RecoveryAvailabilitySetCustomDetails content of the underlying type. - GetRecoveryAvailabilitySetCustomDetails() *RecoveryAvailabilitySetCustomDetails -} - // RecoveryAvailabilitySetCustomDetails - Recovery Availability Set custom input. type RecoveryAvailabilitySetCustomDetails struct { // REQUIRED; The class type. @@ -8194,15 +8060,6 @@ type RecoveryPlanAction struct { FailoverTypes []*ReplicationProtectedItemOperation } -// RecoveryPlanActionDetailsClassification provides polymorphic access to related types. -// Call the interface's GetRecoveryPlanActionDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *RecoveryPlanActionDetails, *RecoveryPlanAutomationRunbookActionDetails, *RecoveryPlanManualActionDetails, *RecoveryPlanScriptActionDetails -type RecoveryPlanActionDetailsClassification interface { - // GetRecoveryPlanActionDetails returns the RecoveryPlanActionDetails content of the underlying type. - GetRecoveryPlanActionDetails() *RecoveryPlanActionDetails -} - // RecoveryPlanActionDetails - Recovery plan action custom details. type RecoveryPlanActionDetails struct { // REQUIRED; Gets the type of action details (see RecoveryPlanActionDetailsTypes enum for possible values). @@ -8260,16 +8117,6 @@ type RecoveryPlanGroup struct { StartGroupActions []*RecoveryPlanAction } -// RecoveryPlanGroupTaskDetailsClassification provides polymorphic access to related types. -// Call the interface's GetRecoveryPlanGroupTaskDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *RecoveryPlanGroupTaskDetails, *RecoveryPlanShutdownGroupTaskDetails -type RecoveryPlanGroupTaskDetailsClassification interface { - GroupTaskDetailsClassification - // GetRecoveryPlanGroupTaskDetails returns the RecoveryPlanGroupTaskDetails content of the underlying type. - GetRecoveryPlanGroupTaskDetails() *RecoveryPlanGroupTaskDetails -} - // RecoveryPlanGroupTaskDetails - This class represents the recovery plan group task. type RecoveryPlanGroupTaskDetails struct { // REQUIRED; The type of task details. @@ -8291,8 +8138,8 @@ type RecoveryPlanGroupTaskDetails struct { // GetGroupTaskDetails implements the GroupTaskDetailsClassification interface for type RecoveryPlanGroupTaskDetails. func (r *RecoveryPlanGroupTaskDetails) GetGroupTaskDetails() *GroupTaskDetails { return &GroupTaskDetails{ - InstanceType: r.InstanceType, ChildTasks: r.ChildTasks, + InstanceType: r.InstanceType, } } @@ -8512,15 +8359,6 @@ type RecoveryPlanProtectedItem struct { VirtualMachineID *string } -// RecoveryPlanProviderSpecificDetailsClassification provides polymorphic access to related types. -// Call the interface's GetRecoveryPlanProviderSpecificDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *RecoveryPlanA2ADetails, *RecoveryPlanProviderSpecificDetails -type RecoveryPlanProviderSpecificDetailsClassification interface { - // GetRecoveryPlanProviderSpecificDetails returns the RecoveryPlanProviderSpecificDetails content of the underlying type. - GetRecoveryPlanProviderSpecificDetails() *RecoveryPlanProviderSpecificDetails -} - // RecoveryPlanProviderSpecificDetails - Recovery plan provider specific details. type RecoveryPlanProviderSpecificDetails struct { // REQUIRED; Gets the Instance type. @@ -8533,17 +8371,6 @@ func (r *RecoveryPlanProviderSpecificDetails) GetRecoveryPlanProviderSpecificDet return r } -// RecoveryPlanProviderSpecificFailoverInputClassification provides polymorphic access to related types. -// Call the interface's GetRecoveryPlanProviderSpecificFailoverInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *RecoveryPlanA2AFailoverInput, *RecoveryPlanHyperVReplicaAzureFailbackInput, *RecoveryPlanHyperVReplicaAzureFailoverInput, -// - *RecoveryPlanInMageAzureV2FailoverInput, *RecoveryPlanInMageFailoverInput, *RecoveryPlanInMageRcmFailbackFailoverInput, -// - *RecoveryPlanInMageRcmFailoverInput, *RecoveryPlanProviderSpecificFailoverInput -type RecoveryPlanProviderSpecificFailoverInputClassification interface { - // GetRecoveryPlanProviderSpecificFailoverInput returns the RecoveryPlanProviderSpecificFailoverInput content of the underlying type. - GetRecoveryPlanProviderSpecificFailoverInput() *RecoveryPlanProviderSpecificFailoverInput -} - // RecoveryPlanProviderSpecificFailoverInput - Recovery plan provider specific failover input. type RecoveryPlanProviderSpecificFailoverInput struct { // REQUIRED; The class type. @@ -8556,15 +8383,6 @@ func (r *RecoveryPlanProviderSpecificFailoverInput) GetRecoveryPlanProviderSpeci return r } -// RecoveryPlanProviderSpecificInputClassification provides polymorphic access to related types. -// Call the interface's GetRecoveryPlanProviderSpecificInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *RecoveryPlanA2AInput, *RecoveryPlanProviderSpecificInput -type RecoveryPlanProviderSpecificInputClassification interface { - // GetRecoveryPlanProviderSpecificInput returns the RecoveryPlanProviderSpecificInput content of the underlying type. - GetRecoveryPlanProviderSpecificInput() *RecoveryPlanProviderSpecificInput -} - // RecoveryPlanProviderSpecificInput - Recovery plan provider specific input base class. type RecoveryPlanProviderSpecificInput struct { // REQUIRED; Gets the Instance type. @@ -8620,19 +8438,19 @@ type RecoveryPlanShutdownGroupTaskDetails struct { // GetGroupTaskDetails implements the GroupTaskDetailsClassification interface for type RecoveryPlanShutdownGroupTaskDetails. func (r *RecoveryPlanShutdownGroupTaskDetails) GetGroupTaskDetails() *GroupTaskDetails { return &GroupTaskDetails{ - InstanceType: r.InstanceType, ChildTasks: r.ChildTasks, + InstanceType: r.InstanceType, } } // GetRecoveryPlanGroupTaskDetails implements the RecoveryPlanGroupTaskDetailsClassification interface for type RecoveryPlanShutdownGroupTaskDetails. func (r *RecoveryPlanShutdownGroupTaskDetails) GetRecoveryPlanGroupTaskDetails() *RecoveryPlanGroupTaskDetails { return &RecoveryPlanGroupTaskDetails{ - Name: r.Name, + ChildTasks: r.ChildTasks, GroupID: r.GroupID, - RpGroupType: r.RpGroupType, InstanceType: r.InstanceType, - ChildTasks: r.ChildTasks, + Name: r.Name, + RpGroupType: r.RpGroupType, } } @@ -8726,26 +8544,6 @@ type RecoveryPointProperties struct { RecoveryPointType *string } -// RecoveryPointsClientGetOptions contains the optional parameters for the RecoveryPointsClient.Get method. -type RecoveryPointsClientGetOptions struct { - // placeholder for future optional parameters -} - -// RecoveryPointsClientListByReplicationProtectedItemsOptions contains the optional parameters for the RecoveryPointsClient.NewListByReplicationProtectedItemsPager -// method. -type RecoveryPointsClientListByReplicationProtectedItemsOptions struct { - // placeholder for future optional parameters -} - -// RecoveryProximityPlacementGroupCustomDetailsClassification provides polymorphic access to related types. -// Call the interface's GetRecoveryProximityPlacementGroupCustomDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ExistingRecoveryProximityPlacementGroup, *RecoveryProximityPlacementGroupCustomDetails -type RecoveryProximityPlacementGroupCustomDetailsClassification interface { - // GetRecoveryProximityPlacementGroupCustomDetails returns the RecoveryProximityPlacementGroupCustomDetails content of the underlying type. - GetRecoveryProximityPlacementGroupCustomDetails() *RecoveryProximityPlacementGroupCustomDetails -} - // RecoveryProximityPlacementGroupCustomDetails - Recovery Proximity placement group custom input. type RecoveryProximityPlacementGroupCustomDetails struct { // REQUIRED; The class type. @@ -8758,15 +8556,6 @@ func (r *RecoveryProximityPlacementGroupCustomDetails) GetRecoveryProximityPlace return r } -// RecoveryResourceGroupCustomDetailsClassification provides polymorphic access to related types. -// Call the interface's GetRecoveryResourceGroupCustomDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ExistingRecoveryResourceGroup, *RecoveryResourceGroupCustomDetails -type RecoveryResourceGroupCustomDetailsClassification interface { - // GetRecoveryResourceGroupCustomDetails returns the RecoveryResourceGroupCustomDetails content of the underlying type. - GetRecoveryResourceGroupCustomDetails() *RecoveryResourceGroupCustomDetails -} - // RecoveryResourceGroupCustomDetails - Recovery Resource Group custom input. type RecoveryResourceGroupCustomDetails struct { // REQUIRED; The class type. @@ -8869,15 +8658,6 @@ type RecoveryServicesProviderProperties struct { ServerVersion *string } -// RecoveryVirtualNetworkCustomDetailsClassification provides polymorphic access to related types. -// Call the interface's GetRecoveryVirtualNetworkCustomDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ExistingRecoveryVirtualNetwork, *NewRecoveryVirtualNetwork, *RecoveryVirtualNetworkCustomDetails -type RecoveryVirtualNetworkCustomDetailsClassification interface { - // GetRecoveryVirtualNetworkCustomDetails returns the RecoveryVirtualNetworkCustomDetails content of the underlying type. - GetRecoveryVirtualNetworkCustomDetails() *RecoveryVirtualNetworkCustomDetails -} - // RecoveryVirtualNetworkCustomDetails - Recovery Virtual network custom input. type RecoveryVirtualNetworkCustomDetails struct { // REQUIRED; The class type. @@ -8904,15 +8684,6 @@ type RemoveDisksInputProperties struct { ProviderSpecificDetails RemoveDisksProviderSpecificInputClassification } -// RemoveDisksProviderSpecificInputClassification provides polymorphic access to related types. -// Call the interface's GetRemoveDisksProviderSpecificInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *A2ARemoveDisksInput, *RemoveDisksProviderSpecificInput -type RemoveDisksProviderSpecificInputClassification interface { - // GetRemoveDisksProviderSpecificInput returns the RemoveDisksProviderSpecificInput content of the underlying type. - GetRemoveDisksProviderSpecificInput() *RemoveDisksProviderSpecificInput -} - // RemoveDisksProviderSpecificInput - Remove Disk provider specific input. type RemoveDisksProviderSpecificInput struct { // REQUIRED; The class type. @@ -8978,23 +8749,6 @@ type ReplicationAgentDetails struct { Version *string } -// ReplicationAlertSettingsClientCreateOptions contains the optional parameters for the ReplicationAlertSettingsClient.Create -// method. -type ReplicationAlertSettingsClientCreateOptions struct { - // placeholder for future optional parameters -} - -// ReplicationAlertSettingsClientGetOptions contains the optional parameters for the ReplicationAlertSettingsClient.Get method. -type ReplicationAlertSettingsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ReplicationAlertSettingsClientListOptions contains the optional parameters for the ReplicationAlertSettingsClient.NewListPager -// method. -type ReplicationAlertSettingsClientListOptions struct { - // placeholder for future optional parameters -} - // ReplicationAppliance - Replication appliance definition. type ReplicationAppliance struct { // Appliance related data. @@ -9007,13 +8761,6 @@ type ReplicationApplianceProperties struct { ProviderSpecificDetails ApplianceSpecificDetailsClassification } -// ReplicationAppliancesClientListOptions contains the optional parameters for the ReplicationAppliancesClient.NewListPager -// method. -type ReplicationAppliancesClientListOptions struct { - // OData filter options. - Filter *string -} - // ReplicationEligibilityResults - Replication eligibility results response model. type ReplicationEligibilityResults struct { // READ-ONLY; Gets Unique ARM identifier for this object. @@ -9029,18 +8776,6 @@ type ReplicationEligibilityResults struct { Type *string } -// ReplicationEligibilityResultsClientGetOptions contains the optional parameters for the ReplicationEligibilityResultsClient.Get -// method. -type ReplicationEligibilityResultsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ReplicationEligibilityResultsClientListOptions contains the optional parameters for the ReplicationEligibilityResultsClient.List -// method. -type ReplicationEligibilityResultsClientListOptions struct { - // placeholder for future optional parameters -} - // ReplicationEligibilityResultsCollection - Replication eligibility results collection response model. type ReplicationEligibilityResultsCollection struct { // The replication eligibility results details. @@ -9074,77 +8809,6 @@ type ReplicationEligibilityResultsProperties struct { ClientRequestID *string } -// ReplicationEventsClientGetOptions contains the optional parameters for the ReplicationEventsClient.Get method. -type ReplicationEventsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ReplicationEventsClientListOptions contains the optional parameters for the ReplicationEventsClient.NewListPager method. -type ReplicationEventsClientListOptions struct { - // OData filter options. - Filter *string -} - -// ReplicationFabricsClientBeginCheckConsistencyOptions contains the optional parameters for the ReplicationFabricsClient.BeginCheckConsistency -// method. -type ReplicationFabricsClientBeginCheckConsistencyOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationFabricsClientBeginCreateOptions contains the optional parameters for the ReplicationFabricsClient.BeginCreate -// method. -type ReplicationFabricsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationFabricsClientBeginDeleteOptions contains the optional parameters for the ReplicationFabricsClient.BeginDelete -// method. -type ReplicationFabricsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationFabricsClientBeginMigrateToAADOptions contains the optional parameters for the ReplicationFabricsClient.BeginMigrateToAAD -// method. -type ReplicationFabricsClientBeginMigrateToAADOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationFabricsClientBeginPurgeOptions contains the optional parameters for the ReplicationFabricsClient.BeginPurge -// method. -type ReplicationFabricsClientBeginPurgeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationFabricsClientBeginReassociateGatewayOptions contains the optional parameters for the ReplicationFabricsClient.BeginReassociateGateway -// method. -type ReplicationFabricsClientBeginReassociateGatewayOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationFabricsClientBeginRenewCertificateOptions contains the optional parameters for the ReplicationFabricsClient.BeginRenewCertificate -// method. -type ReplicationFabricsClientBeginRenewCertificateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationFabricsClientGetOptions contains the optional parameters for the ReplicationFabricsClient.Get method. -type ReplicationFabricsClientGetOptions struct { - // OData filter options. - Filter *string -} - -// ReplicationFabricsClientListOptions contains the optional parameters for the ReplicationFabricsClient.NewListPager method. -type ReplicationFabricsClientListOptions struct { - // placeholder for future optional parameters -} - // ReplicationGroupDetails - Replication group details. This will be used in case of San. type ReplicationGroupDetails struct { // REQUIRED; Gets the class type. Overridden in derived classes. @@ -9158,292 +8822,49 @@ func (r *ReplicationGroupDetails) GetConfigurationSettings() *ConfigurationSetti } } -// ReplicationJobsClientBeginCancelOptions contains the optional parameters for the ReplicationJobsClient.BeginCancel method. -type ReplicationJobsClientBeginCancelOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationJobsClientBeginExportOptions contains the optional parameters for the ReplicationJobsClient.BeginExport method. -type ReplicationJobsClientBeginExportOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} +// ReplicationProtectedItem - Replication protected item. +type ReplicationProtectedItem struct { + // Resource Location + Location *string -// ReplicationJobsClientBeginRestartOptions contains the optional parameters for the ReplicationJobsClient.BeginRestart method. -type ReplicationJobsClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} + // The custom data. + Properties *ReplicationProtectedItemProperties -// ReplicationJobsClientBeginResumeOptions contains the optional parameters for the ReplicationJobsClient.BeginResume method. -type ReplicationJobsClientBeginResumeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} + // READ-ONLY; Resource Id + ID *string -// ReplicationJobsClientGetOptions contains the optional parameters for the ReplicationJobsClient.Get method. -type ReplicationJobsClientGetOptions struct { - // placeholder for future optional parameters -} + // READ-ONLY; Resource Name + Name *string -// ReplicationJobsClientListOptions contains the optional parameters for the ReplicationJobsClient.NewListPager method. -type ReplicationJobsClientListOptions struct { - // OData filter options. - Filter *string + // READ-ONLY; Resource Type + Type *string } -// ReplicationLogicalNetworksClientGetOptions contains the optional parameters for the ReplicationLogicalNetworksClient.Get -// method. -type ReplicationLogicalNetworksClientGetOptions struct { - // placeholder for future optional parameters -} +// ReplicationProtectedItemCollection - Replication protected item collection. +type ReplicationProtectedItemCollection struct { + // The value of next link. + NextLink *string -// ReplicationLogicalNetworksClientListByReplicationFabricsOptions contains the optional parameters for the ReplicationLogicalNetworksClient.NewListByReplicationFabricsPager -// method. -type ReplicationLogicalNetworksClientListByReplicationFabricsOptions struct { - // placeholder for future optional parameters + // The Replication protected item details. + Value []*ReplicationProtectedItem } -// ReplicationMigrationItemsClientBeginCreateOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginCreate -// method. -type ReplicationMigrationItemsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} +// ReplicationProtectedItemProperties - Replication protected item custom data details. +type ReplicationProtectedItemProperties struct { + // The Current active location of the PE. + ActiveLocation *string -// ReplicationMigrationItemsClientBeginDeleteOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginDelete -// method. -type ReplicationMigrationItemsClientBeginDeleteOptions struct { - // The delete option. - DeleteOption *string - // Resumes the LRO from the provided token. - ResumeToken string -} + // The allowed operations on the Replication protected item. + AllowedOperations []*string -// ReplicationMigrationItemsClientBeginMigrateOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginMigrate -// method. -type ReplicationMigrationItemsClientBeginMigrateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} + // The current scenario. + CurrentScenario *CurrentScenarioDetails -// ReplicationMigrationItemsClientBeginPauseReplicationOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginPauseReplication -// method. -type ReplicationMigrationItemsClientBeginPauseReplicationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} + // The correlation Id for events associated with this protected item. + EventCorrelationID *string -// ReplicationMigrationItemsClientBeginResumeReplicationOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginResumeReplication -// method. -type ReplicationMigrationItemsClientBeginResumeReplicationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationMigrationItemsClientBeginResyncOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginResync -// method. -type ReplicationMigrationItemsClientBeginResyncOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationMigrationItemsClientBeginTestMigrateCleanupOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginTestMigrateCleanup -// method. -type ReplicationMigrationItemsClientBeginTestMigrateCleanupOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationMigrationItemsClientBeginTestMigrateOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginTestMigrate -// method. -type ReplicationMigrationItemsClientBeginTestMigrateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationMigrationItemsClientBeginUpdateOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginUpdate -// method. -type ReplicationMigrationItemsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationMigrationItemsClientGetOptions contains the optional parameters for the ReplicationMigrationItemsClient.Get -// method. -type ReplicationMigrationItemsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ReplicationMigrationItemsClientListByReplicationProtectionContainersOptions contains the optional parameters for the ReplicationMigrationItemsClient.NewListByReplicationProtectionContainersPager -// method. -type ReplicationMigrationItemsClientListByReplicationProtectionContainersOptions struct { - // OData filter options. - Filter *string - // The pagination token. - SkipToken *string - // The page size. - TakeToken *string -} - -// ReplicationMigrationItemsClientListOptions contains the optional parameters for the ReplicationMigrationItemsClient.NewListPager -// method. -type ReplicationMigrationItemsClientListOptions struct { - // OData filter options. - Filter *string - // The pagination token. - SkipToken *string - // The page size. - TakeToken *string -} - -// ReplicationNetworkMappingsClientBeginCreateOptions contains the optional parameters for the ReplicationNetworkMappingsClient.BeginCreate -// method. -type ReplicationNetworkMappingsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationNetworkMappingsClientBeginDeleteOptions contains the optional parameters for the ReplicationNetworkMappingsClient.BeginDelete -// method. -type ReplicationNetworkMappingsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationNetworkMappingsClientBeginUpdateOptions contains the optional parameters for the ReplicationNetworkMappingsClient.BeginUpdate -// method. -type ReplicationNetworkMappingsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationNetworkMappingsClientGetOptions contains the optional parameters for the ReplicationNetworkMappingsClient.Get -// method. -type ReplicationNetworkMappingsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ReplicationNetworkMappingsClientListByReplicationNetworksOptions contains the optional parameters for the ReplicationNetworkMappingsClient.NewListByReplicationNetworksPager -// method. -type ReplicationNetworkMappingsClientListByReplicationNetworksOptions struct { - // placeholder for future optional parameters -} - -// ReplicationNetworkMappingsClientListOptions contains the optional parameters for the ReplicationNetworkMappingsClient.NewListPager -// method. -type ReplicationNetworkMappingsClientListOptions struct { - // placeholder for future optional parameters -} - -// ReplicationNetworksClientGetOptions contains the optional parameters for the ReplicationNetworksClient.Get method. -type ReplicationNetworksClientGetOptions struct { - // placeholder for future optional parameters -} - -// ReplicationNetworksClientListByReplicationFabricsOptions contains the optional parameters for the ReplicationNetworksClient.NewListByReplicationFabricsPager -// method. -type ReplicationNetworksClientListByReplicationFabricsOptions struct { - // placeholder for future optional parameters -} - -// ReplicationNetworksClientListOptions contains the optional parameters for the ReplicationNetworksClient.NewListPager method. -type ReplicationNetworksClientListOptions struct { - // placeholder for future optional parameters -} - -// ReplicationPoliciesClientBeginCreateOptions contains the optional parameters for the ReplicationPoliciesClient.BeginCreate -// method. -type ReplicationPoliciesClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationPoliciesClientBeginDeleteOptions contains the optional parameters for the ReplicationPoliciesClient.BeginDelete -// method. -type ReplicationPoliciesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationPoliciesClientBeginUpdateOptions contains the optional parameters for the ReplicationPoliciesClient.BeginUpdate -// method. -type ReplicationPoliciesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationPoliciesClientGetOptions contains the optional parameters for the ReplicationPoliciesClient.Get method. -type ReplicationPoliciesClientGetOptions struct { - // placeholder for future optional parameters -} - -// ReplicationPoliciesClientListOptions contains the optional parameters for the ReplicationPoliciesClient.NewListPager method. -type ReplicationPoliciesClientListOptions struct { - // placeholder for future optional parameters -} - -// ReplicationProtectableItemsClientGetOptions contains the optional parameters for the ReplicationProtectableItemsClient.Get -// method. -type ReplicationProtectableItemsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ReplicationProtectableItemsClientListByReplicationProtectionContainersOptions contains the optional parameters for the -// ReplicationProtectableItemsClient.NewListByReplicationProtectionContainersPager method. -type ReplicationProtectableItemsClientListByReplicationProtectionContainersOptions struct { - // OData filter options. - Filter *string - // skipToken OData query parameter. - SkipToken *string - // take OData query parameter. - Take *string -} - -// ReplicationProtectedItem - Replication protected item. -type ReplicationProtectedItem struct { - // Resource Location - Location *string - - // The custom data. - Properties *ReplicationProtectedItemProperties - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource Name - Name *string - - // READ-ONLY; Resource Type - Type *string -} - -// ReplicationProtectedItemCollection - Replication protected item collection. -type ReplicationProtectedItemCollection struct { - // The value of next link. - NextLink *string - - // The Replication protected item details. - Value []*ReplicationProtectedItem -} - -// ReplicationProtectedItemProperties - Replication protected item custom data details. -type ReplicationProtectedItemProperties struct { - // The Current active location of the PE. - ActiveLocation *string - - // The allowed operations on the Replication protected item. - AllowedOperations []*string - - // The current scenario. - CurrentScenario *CurrentScenarioDetails - - // The correlation Id for events associated with this protected item. - EventCorrelationID *string - - // The consolidated failover health for the VM. - FailoverHealth *string + // The consolidated failover health for the VM. + FailoverHealth *string // The recovery point ARM Id to which the Vm was failed over. FailoverRecoveryPointID *string @@ -9523,252 +8944,6 @@ type ReplicationProtectedItemProperties struct { TestFailoverStateDescription *string } -// ReplicationProtectedItemsClientBeginAddDisksOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginAddDisks -// method. -type ReplicationProtectedItemsClientBeginAddDisksOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectedItemsClientBeginApplyRecoveryPointOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginApplyRecoveryPoint -// method. -type ReplicationProtectedItemsClientBeginApplyRecoveryPointOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectedItemsClientBeginCreateOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginCreate -// method. -type ReplicationProtectedItemsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectedItemsClientBeginDeleteOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginDelete -// method. -type ReplicationProtectedItemsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectedItemsClientBeginFailoverCancelOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginFailoverCancel -// method. -type ReplicationProtectedItemsClientBeginFailoverCancelOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectedItemsClientBeginFailoverCommitOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginFailoverCommit -// method. -type ReplicationProtectedItemsClientBeginFailoverCommitOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectedItemsClientBeginPlannedFailoverOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginPlannedFailover -// method. -type ReplicationProtectedItemsClientBeginPlannedFailoverOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectedItemsClientBeginPurgeOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginPurge -// method. -type ReplicationProtectedItemsClientBeginPurgeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectedItemsClientBeginRemoveDisksOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginRemoveDisks -// method. -type ReplicationProtectedItemsClientBeginRemoveDisksOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectedItemsClientBeginRepairReplicationOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginRepairReplication -// method. -type ReplicationProtectedItemsClientBeginRepairReplicationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectedItemsClientBeginReprotectOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginReprotect -// method. -type ReplicationProtectedItemsClientBeginReprotectOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectedItemsClientBeginResolveHealthErrorsOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginResolveHealthErrors -// method. -type ReplicationProtectedItemsClientBeginResolveHealthErrorsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectedItemsClientBeginSwitchProviderOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginSwitchProvider -// method. -type ReplicationProtectedItemsClientBeginSwitchProviderOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectedItemsClientBeginTestFailoverCleanupOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginTestFailoverCleanup -// method. -type ReplicationProtectedItemsClientBeginTestFailoverCleanupOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectedItemsClientBeginTestFailoverOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginTestFailover -// method. -type ReplicationProtectedItemsClientBeginTestFailoverOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectedItemsClientBeginUnplannedFailoverOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginUnplannedFailover -// method. -type ReplicationProtectedItemsClientBeginUnplannedFailoverOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectedItemsClientBeginUpdateApplianceOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginUpdateAppliance -// method. -type ReplicationProtectedItemsClientBeginUpdateApplianceOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectedItemsClientBeginUpdateMobilityServiceOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginUpdateMobilityService -// method. -type ReplicationProtectedItemsClientBeginUpdateMobilityServiceOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectedItemsClientBeginUpdateOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginUpdate -// method. -type ReplicationProtectedItemsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectedItemsClientGetOptions contains the optional parameters for the ReplicationProtectedItemsClient.Get -// method. -type ReplicationProtectedItemsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ReplicationProtectedItemsClientListByReplicationProtectionContainersOptions contains the optional parameters for the ReplicationProtectedItemsClient.NewListByReplicationProtectionContainersPager -// method. -type ReplicationProtectedItemsClientListByReplicationProtectionContainersOptions struct { - // placeholder for future optional parameters -} - -// ReplicationProtectedItemsClientListOptions contains the optional parameters for the ReplicationProtectedItemsClient.NewListPager -// method. -type ReplicationProtectedItemsClientListOptions struct { - // OData filter options. - Filter *string - // The pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. - SkipToken *string -} - -// ReplicationProtectionContainerMappingsClientBeginCreateOptions contains the optional parameters for the ReplicationProtectionContainerMappingsClient.BeginCreate -// method. -type ReplicationProtectionContainerMappingsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectionContainerMappingsClientBeginDeleteOptions contains the optional parameters for the ReplicationProtectionContainerMappingsClient.BeginDelete -// method. -type ReplicationProtectionContainerMappingsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectionContainerMappingsClientBeginPurgeOptions contains the optional parameters for the ReplicationProtectionContainerMappingsClient.BeginPurge -// method. -type ReplicationProtectionContainerMappingsClientBeginPurgeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectionContainerMappingsClientBeginUpdateOptions contains the optional parameters for the ReplicationProtectionContainerMappingsClient.BeginUpdate -// method. -type ReplicationProtectionContainerMappingsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectionContainerMappingsClientGetOptions contains the optional parameters for the ReplicationProtectionContainerMappingsClient.Get -// method. -type ReplicationProtectionContainerMappingsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ReplicationProtectionContainerMappingsClientListByReplicationProtectionContainersOptions contains the optional parameters -// for the ReplicationProtectionContainerMappingsClient.NewListByReplicationProtectionContainersPager method. -type ReplicationProtectionContainerMappingsClientListByReplicationProtectionContainersOptions struct { - // placeholder for future optional parameters -} - -// ReplicationProtectionContainerMappingsClientListOptions contains the optional parameters for the ReplicationProtectionContainerMappingsClient.NewListPager -// method. -type ReplicationProtectionContainerMappingsClientListOptions struct { - // placeholder for future optional parameters -} - -// ReplicationProtectionContainersClientBeginCreateOptions contains the optional parameters for the ReplicationProtectionContainersClient.BeginCreate -// method. -type ReplicationProtectionContainersClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectionContainersClientBeginDeleteOptions contains the optional parameters for the ReplicationProtectionContainersClient.BeginDelete -// method. -type ReplicationProtectionContainersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectionContainersClientBeginDiscoverProtectableItemOptions contains the optional parameters for the ReplicationProtectionContainersClient.BeginDiscoverProtectableItem -// method. -type ReplicationProtectionContainersClientBeginDiscoverProtectableItemOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectionContainersClientBeginSwitchProtectionOptions contains the optional parameters for the ReplicationProtectionContainersClient.BeginSwitchProtection -// method. -type ReplicationProtectionContainersClientBeginSwitchProtectionOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationProtectionContainersClientGetOptions contains the optional parameters for the ReplicationProtectionContainersClient.Get -// method. -type ReplicationProtectionContainersClientGetOptions struct { - // placeholder for future optional parameters -} - -// ReplicationProtectionContainersClientListByReplicationFabricsOptions contains the optional parameters for the ReplicationProtectionContainersClient.NewListByReplicationFabricsPager -// method. -type ReplicationProtectionContainersClientListByReplicationFabricsOptions struct { - // placeholder for future optional parameters -} - -// ReplicationProtectionContainersClientListOptions contains the optional parameters for the ReplicationProtectionContainersClient.NewListPager -// method. -type ReplicationProtectionContainersClientListOptions struct { - // placeholder for future optional parameters -} - // ReplicationProtectionIntent - Replication protection intent. type ReplicationProtectionIntent struct { // Resource Location @@ -9817,15 +8992,6 @@ type ReplicationProtectionIntentProperties struct { JobState *string } -// ReplicationProtectionIntentProviderSpecificSettingsClassification provides polymorphic access to related types. -// Call the interface's GetReplicationProtectionIntentProviderSpecificSettings() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *A2AReplicationIntentDetails, *ReplicationProtectionIntentProviderSpecificSettings -type ReplicationProtectionIntentProviderSpecificSettingsClassification interface { - // GetReplicationProtectionIntentProviderSpecificSettings returns the ReplicationProtectionIntentProviderSpecificSettings content of the underlying type. - GetReplicationProtectionIntentProviderSpecificSettings() *ReplicationProtectionIntentProviderSpecificSettings -} - // ReplicationProtectionIntentProviderSpecificSettings - Replication provider specific settings. type ReplicationProtectionIntentProviderSpecificSettings struct { // REQUIRED; Gets the Instance type. @@ -9838,43 +9004,12 @@ func (r *ReplicationProtectionIntentProviderSpecificSettings) GetReplicationProt return r } -// ReplicationProtectionIntentsClientCreateOptions contains the optional parameters for the ReplicationProtectionIntentsClient.Create -// method. -type ReplicationProtectionIntentsClientCreateOptions struct { - // placeholder for future optional parameters -} - -// ReplicationProtectionIntentsClientGetOptions contains the optional parameters for the ReplicationProtectionIntentsClient.Get -// method. -type ReplicationProtectionIntentsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ReplicationProtectionIntentsClientListOptions contains the optional parameters for the ReplicationProtectionIntentsClient.NewListPager -// method. -type ReplicationProtectionIntentsClientListOptions struct { - // The pagination token. - SkipToken *string - // The page size. - TakeToken *string -} - // ReplicationProviderContainerUnmappingInput - Provider specific input for unpairing operations. type ReplicationProviderContainerUnmappingInput struct { // The class type. InstanceType *string } -// ReplicationProviderSpecificContainerCreationInputClassification provides polymorphic access to related types. -// Call the interface's GetReplicationProviderSpecificContainerCreationInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *A2AContainerCreationInput, *A2ACrossClusterMigrationContainerCreationInput, *ReplicationProviderSpecificContainerCreationInput, -// - *VMwareCbtContainerCreationInput -type ReplicationProviderSpecificContainerCreationInputClassification interface { - // GetReplicationProviderSpecificContainerCreationInput returns the ReplicationProviderSpecificContainerCreationInput content of the underlying type. - GetReplicationProviderSpecificContainerCreationInput() *ReplicationProviderSpecificContainerCreationInput -} - // ReplicationProviderSpecificContainerCreationInput - Provider specific input for container creation operation. type ReplicationProviderSpecificContainerCreationInput struct { // REQUIRED; The class type. @@ -9887,15 +9022,6 @@ func (r *ReplicationProviderSpecificContainerCreationInput) GetReplicationProvid return r } -// ReplicationProviderSpecificContainerMappingInputClassification provides polymorphic access to related types. -// Call the interface's GetReplicationProviderSpecificContainerMappingInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *A2AContainerMappingInput, *ReplicationProviderSpecificContainerMappingInput, *VMwareCbtContainerMappingInput -type ReplicationProviderSpecificContainerMappingInputClassification interface { - // GetReplicationProviderSpecificContainerMappingInput returns the ReplicationProviderSpecificContainerMappingInput content of the underlying type. - GetReplicationProviderSpecificContainerMappingInput() *ReplicationProviderSpecificContainerMappingInput -} - // ReplicationProviderSpecificContainerMappingInput - Provider specific input for pairing operations. type ReplicationProviderSpecificContainerMappingInput struct { // REQUIRED; The class type. @@ -9908,17 +9034,6 @@ func (r *ReplicationProviderSpecificContainerMappingInput) GetReplicationProvide return r } -// ReplicationProviderSpecificSettingsClassification provides polymorphic access to related types. -// Call the interface's GetReplicationProviderSpecificSettings() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *A2ACrossClusterMigrationReplicationDetails, *A2AReplicationDetails, *HyperVReplicaAzureReplicationDetails, *HyperVReplicaBaseReplicationDetails, -// - *HyperVReplicaBlueReplicationDetails, *HyperVReplicaReplicationDetails, *InMageAzureV2ReplicationDetails, *InMageRcmFailbackReplicationDetails, -// - *InMageRcmReplicationDetails, *InMageReplicationDetails, *ReplicationProviderSpecificSettings -type ReplicationProviderSpecificSettingsClassification interface { - // GetReplicationProviderSpecificSettings returns the ReplicationProviderSpecificSettings content of the underlying type. - GetReplicationProviderSpecificSettings() *ReplicationProviderSpecificSettings -} - // ReplicationProviderSpecificSettings - Replication provider specific settings. type ReplicationProviderSpecificSettings struct { // REQUIRED; Gets the Instance type. @@ -9931,15 +9046,6 @@ func (r *ReplicationProviderSpecificSettings) GetReplicationProviderSpecificSett return r } -// ReplicationProviderSpecificUpdateContainerMappingInputClassification provides polymorphic access to related types. -// Call the interface's GetReplicationProviderSpecificUpdateContainerMappingInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *A2AUpdateContainerMappingInput, *InMageRcmUpdateContainerMappingInput, *ReplicationProviderSpecificUpdateContainerMappingInput -type ReplicationProviderSpecificUpdateContainerMappingInputClassification interface { - // GetReplicationProviderSpecificUpdateContainerMappingInput returns the ReplicationProviderSpecificUpdateContainerMappingInput content of the underlying type. - GetReplicationProviderSpecificUpdateContainerMappingInput() *ReplicationProviderSpecificUpdateContainerMappingInput -} - // ReplicationProviderSpecificUpdateContainerMappingInput - Provider specific input for update pairing operations. type ReplicationProviderSpecificUpdateContainerMappingInput struct { // REQUIRED; The class type. @@ -9952,250 +9058,6 @@ func (r *ReplicationProviderSpecificUpdateContainerMappingInput) GetReplicationP return r } -// ReplicationRecoveryPlansClientBeginCreateOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginCreate -// method. -type ReplicationRecoveryPlansClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationRecoveryPlansClientBeginDeleteOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginDelete -// method. -type ReplicationRecoveryPlansClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationRecoveryPlansClientBeginFailoverCancelOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginFailoverCancel -// method. -type ReplicationRecoveryPlansClientBeginFailoverCancelOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationRecoveryPlansClientBeginFailoverCommitOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginFailoverCommit -// method. -type ReplicationRecoveryPlansClientBeginFailoverCommitOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationRecoveryPlansClientBeginPlannedFailoverOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginPlannedFailover -// method. -type ReplicationRecoveryPlansClientBeginPlannedFailoverOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationRecoveryPlansClientBeginReprotectOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginReprotect -// method. -type ReplicationRecoveryPlansClientBeginReprotectOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationRecoveryPlansClientBeginTestFailoverCleanupOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginTestFailoverCleanup -// method. -type ReplicationRecoveryPlansClientBeginTestFailoverCleanupOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationRecoveryPlansClientBeginTestFailoverOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginTestFailover -// method. -type ReplicationRecoveryPlansClientBeginTestFailoverOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationRecoveryPlansClientBeginUnplannedFailoverOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginUnplannedFailover -// method. -type ReplicationRecoveryPlansClientBeginUnplannedFailoverOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationRecoveryPlansClientBeginUpdateOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginUpdate -// method. -type ReplicationRecoveryPlansClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationRecoveryPlansClientGetOptions contains the optional parameters for the ReplicationRecoveryPlansClient.Get method. -type ReplicationRecoveryPlansClientGetOptions struct { - // placeholder for future optional parameters -} - -// ReplicationRecoveryPlansClientListOptions contains the optional parameters for the ReplicationRecoveryPlansClient.NewListPager -// method. -type ReplicationRecoveryPlansClientListOptions struct { - // placeholder for future optional parameters -} - -// ReplicationRecoveryServicesProvidersClientBeginCreateOptions contains the optional parameters for the ReplicationRecoveryServicesProvidersClient.BeginCreate -// method. -type ReplicationRecoveryServicesProvidersClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationRecoveryServicesProvidersClientBeginDeleteOptions contains the optional parameters for the ReplicationRecoveryServicesProvidersClient.BeginDelete -// method. -type ReplicationRecoveryServicesProvidersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationRecoveryServicesProvidersClientBeginPurgeOptions contains the optional parameters for the ReplicationRecoveryServicesProvidersClient.BeginPurge -// method. -type ReplicationRecoveryServicesProvidersClientBeginPurgeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationRecoveryServicesProvidersClientBeginRefreshProviderOptions contains the optional parameters for the ReplicationRecoveryServicesProvidersClient.BeginRefreshProvider -// method. -type ReplicationRecoveryServicesProvidersClientBeginRefreshProviderOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationRecoveryServicesProvidersClientGetOptions contains the optional parameters for the ReplicationRecoveryServicesProvidersClient.Get -// method. -type ReplicationRecoveryServicesProvidersClientGetOptions struct { - // placeholder for future optional parameters -} - -// ReplicationRecoveryServicesProvidersClientListByReplicationFabricsOptions contains the optional parameters for the ReplicationRecoveryServicesProvidersClient.NewListByReplicationFabricsPager -// method. -type ReplicationRecoveryServicesProvidersClientListByReplicationFabricsOptions struct { - // placeholder for future optional parameters -} - -// ReplicationRecoveryServicesProvidersClientListOptions contains the optional parameters for the ReplicationRecoveryServicesProvidersClient.NewListPager -// method. -type ReplicationRecoveryServicesProvidersClientListOptions struct { - // placeholder for future optional parameters -} - -// ReplicationStorageClassificationMappingsClientBeginCreateOptions contains the optional parameters for the ReplicationStorageClassificationMappingsClient.BeginCreate -// method. -type ReplicationStorageClassificationMappingsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationStorageClassificationMappingsClientBeginDeleteOptions contains the optional parameters for the ReplicationStorageClassificationMappingsClient.BeginDelete -// method. -type ReplicationStorageClassificationMappingsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationStorageClassificationMappingsClientGetOptions contains the optional parameters for the ReplicationStorageClassificationMappingsClient.Get -// method. -type ReplicationStorageClassificationMappingsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ReplicationStorageClassificationMappingsClientListByReplicationStorageClassificationsOptions contains the optional parameters -// for the ReplicationStorageClassificationMappingsClient.NewListByReplicationStorageClassificationsPager method. -type ReplicationStorageClassificationMappingsClientListByReplicationStorageClassificationsOptions struct { - // placeholder for future optional parameters -} - -// ReplicationStorageClassificationMappingsClientListOptions contains the optional parameters for the ReplicationStorageClassificationMappingsClient.NewListPager -// method. -type ReplicationStorageClassificationMappingsClientListOptions struct { - // placeholder for future optional parameters -} - -// ReplicationStorageClassificationsClientGetOptions contains the optional parameters for the ReplicationStorageClassificationsClient.Get -// method. -type ReplicationStorageClassificationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ReplicationStorageClassificationsClientListByReplicationFabricsOptions contains the optional parameters for the ReplicationStorageClassificationsClient.NewListByReplicationFabricsPager -// method. -type ReplicationStorageClassificationsClientListByReplicationFabricsOptions struct { - // placeholder for future optional parameters -} - -// ReplicationStorageClassificationsClientListOptions contains the optional parameters for the ReplicationStorageClassificationsClient.NewListPager -// method. -type ReplicationStorageClassificationsClientListOptions struct { - // placeholder for future optional parameters -} - -// ReplicationVaultHealthClientBeginRefreshOptions contains the optional parameters for the ReplicationVaultHealthClient.BeginRefresh -// method. -type ReplicationVaultHealthClientBeginRefreshOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationVaultHealthClientGetOptions contains the optional parameters for the ReplicationVaultHealthClient.Get method. -type ReplicationVaultHealthClientGetOptions struct { - // placeholder for future optional parameters -} - -// ReplicationVaultSettingClientBeginCreateOptions contains the optional parameters for the ReplicationVaultSettingClient.BeginCreate -// method. -type ReplicationVaultSettingClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationVaultSettingClientGetOptions contains the optional parameters for the ReplicationVaultSettingClient.Get method. -type ReplicationVaultSettingClientGetOptions struct { - // placeholder for future optional parameters -} - -// ReplicationVaultSettingClientListOptions contains the optional parameters for the ReplicationVaultSettingClient.NewListPager -// method. -type ReplicationVaultSettingClientListOptions struct { - // placeholder for future optional parameters -} - -// ReplicationvCentersClientBeginCreateOptions contains the optional parameters for the ReplicationvCentersClient.BeginCreate -// method. -type ReplicationvCentersClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationvCentersClientBeginDeleteOptions contains the optional parameters for the ReplicationvCentersClient.BeginDelete -// method. -type ReplicationvCentersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationvCentersClientBeginUpdateOptions contains the optional parameters for the ReplicationvCentersClient.BeginUpdate -// method. -type ReplicationvCentersClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ReplicationvCentersClientGetOptions contains the optional parameters for the ReplicationvCentersClient.Get method. -type ReplicationvCentersClientGetOptions struct { - // placeholder for future optional parameters -} - -// ReplicationvCentersClientListByReplicationFabricsOptions contains the optional parameters for the ReplicationvCentersClient.NewListByReplicationFabricsPager -// method. -type ReplicationvCentersClientListByReplicationFabricsOptions struct { - // placeholder for future optional parameters -} - -// ReplicationvCentersClientListOptions contains the optional parameters for the ReplicationvCentersClient.NewListPager method. -type ReplicationvCentersClientListOptions struct { - // placeholder for future optional parameters -} - // ReprotectAgentDetails - Reprotect agent details. type ReprotectAgentDetails struct { // READ-ONLY; The list of accessible datastores fetched from discovery. @@ -10307,15 +9169,6 @@ type ResumeReplicationInputProperties struct { ProviderSpecificDetails ResumeReplicationProviderSpecificInputClassification } -// ResumeReplicationProviderSpecificInputClassification provides polymorphic access to related types. -// Call the interface's GetResumeReplicationProviderSpecificInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ResumeReplicationProviderSpecificInput, *VMwareCbtResumeReplicationInput -type ResumeReplicationProviderSpecificInputClassification interface { - // GetResumeReplicationProviderSpecificInput returns the ResumeReplicationProviderSpecificInput content of the underlying type. - GetResumeReplicationProviderSpecificInput() *ResumeReplicationProviderSpecificInput -} - // ResumeReplicationProviderSpecificInput - Resume replication provider specific input. type ResumeReplicationProviderSpecificInput struct { // REQUIRED; The class type. @@ -10340,15 +9193,6 @@ type ResyncInputProperties struct { ProviderSpecificDetails ResyncProviderSpecificInputClassification } -// ResyncProviderSpecificInputClassification provides polymorphic access to related types. -// Call the interface's GetResyncProviderSpecificInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ResyncProviderSpecificInput, *VMwareCbtResyncInput -type ResyncProviderSpecificInputClassification interface { - // GetResyncProviderSpecificInput returns the ResyncProviderSpecificInput content of the underlying type. - GetResyncProviderSpecificInput() *ResyncProviderSpecificInput -} - // ResyncProviderSpecificInput - Resync provider specific input. type ResyncProviderSpecificInput struct { // REQUIRED; The class type. @@ -10390,16 +9234,6 @@ type ReverseReplicationInputProperties struct { ProviderSpecificDetails ReverseReplicationProviderSpecificInputClassification } -// ReverseReplicationProviderSpecificInputClassification provides polymorphic access to related types. -// Call the interface's GetReverseReplicationProviderSpecificInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *A2AReprotectInput, *HyperVReplicaAzureReprotectInput, *InMageAzureV2ReprotectInput, *InMageRcmFailbackReprotectInput, -// - *InMageRcmReprotectInput, *InMageReprotectInput, *ReverseReplicationProviderSpecificInput -type ReverseReplicationProviderSpecificInputClassification interface { - // GetReverseReplicationProviderSpecificInput returns the ReverseReplicationProviderSpecificInput content of the underlying type. - GetReverseReplicationProviderSpecificInput() *ReverseReplicationProviderSpecificInput -} - // ReverseReplicationProviderSpecificInput - Provider specific reverse replication input. type ReverseReplicationProviderSpecificInput struct { // REQUIRED; The class type. @@ -10482,15 +9316,6 @@ type ServiceError struct { RecommendedAction *string } -// StorageAccountCustomDetailsClassification provides polymorphic access to related types. -// Call the interface's GetStorageAccountCustomDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ExistingStorageAccount, *StorageAccountCustomDetails -type StorageAccountCustomDetailsClassification interface { - // GetStorageAccountCustomDetails returns the StorageAccountCustomDetails content of the underlying type. - GetStorageAccountCustomDetails() *StorageAccountCustomDetails -} - // StorageAccountCustomDetails - Storage account custom input. type StorageAccountCustomDetails struct { // REQUIRED; The class type. @@ -10637,13 +9462,6 @@ type SupportedOperatingSystems struct { Type *string } -// SupportedOperatingSystemsClientGetOptions contains the optional parameters for the SupportedOperatingSystemsClient.Get -// method. -type SupportedOperatingSystemsClientGetOptions struct { - // The instance type. - InstanceType *string -} - // SwitchProtectionInput - Switch protection input. type SwitchProtectionInput struct { // Switch protection properties. @@ -10675,20 +9493,11 @@ type SwitchProtectionJobDetails struct { // GetJobDetails implements the JobDetailsClassification interface for type SwitchProtectionJobDetails. func (s *SwitchProtectionJobDetails) GetJobDetails() *JobDetails { return &JobDetails{ - InstanceType: s.InstanceType, AffectedObjectDetails: s.AffectedObjectDetails, + InstanceType: s.InstanceType, } } -// SwitchProtectionProviderSpecificInputClassification provides polymorphic access to related types. -// Call the interface's GetSwitchProtectionProviderSpecificInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *A2ASwitchProtectionInput, *SwitchProtectionProviderSpecificInput -type SwitchProtectionProviderSpecificInputClassification interface { - // GetSwitchProtectionProviderSpecificInput returns the SwitchProtectionProviderSpecificInput content of the underlying type. - GetSwitchProtectionProviderSpecificInput() *SwitchProtectionProviderSpecificInput -} - // SwitchProtectionProviderSpecificInput - Provider specific switch protection input. type SwitchProtectionProviderSpecificInput struct { // REQUIRED; Gets the Instance type. @@ -10716,15 +9525,6 @@ type SwitchProviderInputProperties struct { TargetInstanceType *string } -// SwitchProviderSpecificInputClassification provides polymorphic access to related types. -// Call the interface's GetSwitchProviderSpecificInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *InMageAzureV2SwitchProviderInput, *SwitchProviderSpecificInput -type SwitchProviderSpecificInputClassification interface { - // GetSwitchProviderSpecificInput returns the SwitchProviderSpecificInput content of the underlying type. - GetSwitchProviderSpecificInput() *SwitchProviderSpecificInput -} - // SwitchProviderSpecificInput - Provider specific switch provider input. type SwitchProviderSpecificInput struct { // REQUIRED; The class type. @@ -10793,22 +9593,6 @@ type TargetComputeSizeProperties struct { VCPUsAvailable *int32 } -// TargetComputeSizesClientListByReplicationProtectedItemsOptions contains the optional parameters for the TargetComputeSizesClient.NewListByReplicationProtectedItemsPager -// method. -type TargetComputeSizesClientListByReplicationProtectedItemsOptions struct { - // placeholder for future optional parameters -} - -// TaskTypeDetailsClassification provides polymorphic access to related types. -// Call the interface's GetTaskTypeDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AutomationRunbookTaskDetails, *ConsistencyCheckTaskDetails, *FabricReplicationGroupTaskDetails, *JobTaskDetails, *ManualActionTaskDetails, -// - *ScriptActionTaskDetails, *TaskTypeDetails, *VMNicUpdatesTaskDetails, *VirtualMachineTaskDetails -type TaskTypeDetailsClassification interface { - // GetTaskTypeDetails returns the TaskTypeDetails content of the underlying type. - GetTaskTypeDetails() *TaskTypeDetails -} - // TaskTypeDetails - Task details based on specific task type. type TaskTypeDetails struct { // REQUIRED; The type of task details. @@ -10882,21 +9666,11 @@ type TestFailoverJobDetails struct { // GetJobDetails implements the JobDetailsClassification interface for type TestFailoverJobDetails. func (t *TestFailoverJobDetails) GetJobDetails() *JobDetails { return &JobDetails{ - InstanceType: t.InstanceType, AffectedObjectDetails: t.AffectedObjectDetails, + InstanceType: t.InstanceType, } } -// TestFailoverProviderSpecificInputClassification provides polymorphic access to related types. -// Call the interface's GetTestFailoverProviderSpecificInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *A2ATestFailoverInput, *HyperVReplicaAzureTestFailoverInput, *InMageAzureV2TestFailoverInput, *InMageRcmTestFailoverInput, -// - *InMageTestFailoverInput, *TestFailoverProviderSpecificInput -type TestFailoverProviderSpecificInputClassification interface { - // GetTestFailoverProviderSpecificInput returns the TestFailoverProviderSpecificInput content of the underlying type. - GetTestFailoverProviderSpecificInput() *TestFailoverProviderSpecificInput -} - // TestFailoverProviderSpecificInput - Provider specific test failover input. type TestFailoverProviderSpecificInput struct { // REQUIRED; The class type. @@ -10933,15 +9707,6 @@ type TestMigrateInputProperties struct { ProviderSpecificDetails TestMigrateProviderSpecificInputClassification } -// TestMigrateProviderSpecificInputClassification provides polymorphic access to related types. -// Call the interface's GetTestMigrateProviderSpecificInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *TestMigrateProviderSpecificInput, *VMwareCbtTestMigrateInput -type TestMigrateProviderSpecificInputClassification interface { - // GetTestMigrateProviderSpecificInput returns the TestMigrateProviderSpecificInput content of the underlying type. - GetTestMigrateProviderSpecificInput() *TestMigrateProviderSpecificInput -} - // TestMigrateProviderSpecificInput - Test migrate provider specific input. type TestMigrateProviderSpecificInput struct { // REQUIRED; The class type. @@ -10971,16 +9736,6 @@ type UnplannedFailoverInputProperties struct { SourceSiteOperations *string } -// UnplannedFailoverProviderSpecificInputClassification provides polymorphic access to related types. -// Call the interface's GetUnplannedFailoverProviderSpecificInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *A2AUnplannedFailoverInput, *HyperVReplicaAzureUnplannedFailoverInput, *InMageAzureV2UnplannedFailoverInput, *InMageRcmUnplannedFailoverInput, -// - *InMageUnplannedFailoverInput, *UnplannedFailoverProviderSpecificInput -type UnplannedFailoverProviderSpecificInputClassification interface { - // GetUnplannedFailoverProviderSpecificInput returns the UnplannedFailoverProviderSpecificInput content of the underlying type. - GetUnplannedFailoverProviderSpecificInput() *UnplannedFailoverProviderSpecificInput -} - // UnplannedFailoverProviderSpecificInput - Provider specific unplanned failover input. type UnplannedFailoverProviderSpecificInput struct { // REQUIRED; The class type. @@ -11008,15 +9763,6 @@ type UpdateApplianceForReplicationProtectedItemInputProperties struct { TargetApplianceID *string } -// UpdateApplianceForReplicationProtectedItemProviderSpecificInputClassification provides polymorphic access to related types. -// Call the interface's GetUpdateApplianceForReplicationProtectedItemProviderSpecificInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *InMageRcmUpdateApplianceForReplicationProtectedItemInput, *UpdateApplianceForReplicationProtectedItemProviderSpecificInput -type UpdateApplianceForReplicationProtectedItemProviderSpecificInputClassification interface { - // GetUpdateApplianceForReplicationProtectedItemProviderSpecificInput returns the UpdateApplianceForReplicationProtectedItemProviderSpecificInput content of the underlying type. - GetUpdateApplianceForReplicationProtectedItemProviderSpecificInput() *UpdateApplianceForReplicationProtectedItemProviderSpecificInput -} - // UpdateApplianceForReplicationProtectedItemProviderSpecificInput - Update replication protected item provider specific input. type UpdateApplianceForReplicationProtectedItemProviderSpecificInput struct { // REQUIRED; The class type. @@ -11050,15 +9796,6 @@ type UpdateMigrationItemInputProperties struct { ProviderSpecificDetails UpdateMigrationItemProviderSpecificInputClassification } -// UpdateMigrationItemProviderSpecificInputClassification provides polymorphic access to related types. -// Call the interface's GetUpdateMigrationItemProviderSpecificInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *UpdateMigrationItemProviderSpecificInput, *VMwareCbtUpdateMigrationItemInput -type UpdateMigrationItemProviderSpecificInputClassification interface { - // GetUpdateMigrationItemProviderSpecificInput returns the UpdateMigrationItemProviderSpecificInput content of the underlying type. - GetUpdateMigrationItemProviderSpecificInput() *UpdateMigrationItemProviderSpecificInput -} - // UpdateMigrationItemProviderSpecificInput - Update migration item provider specific input. type UpdateMigrationItemProviderSpecificInput struct { // REQUIRED; The class type. @@ -11177,16 +9914,6 @@ type UpdateReplicationProtectedItemInputProperties struct { VMNics []*VMNicInputDetails } -// UpdateReplicationProtectedItemProviderInputClassification provides polymorphic access to related types. -// Call the interface's GetUpdateReplicationProtectedItemProviderInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *A2AUpdateReplicationProtectedItemInput, *HyperVReplicaAzureUpdateReplicationProtectedItemInput, *InMageAzureV2UpdateReplicationProtectedItemInput, -// - *InMageRcmUpdateReplicationProtectedItemInput, *UpdateReplicationProtectedItemProviderInput -type UpdateReplicationProtectedItemProviderInputClassification interface { - // GetUpdateReplicationProtectedItemProviderInput returns the UpdateReplicationProtectedItemProviderInput content of the underlying type. - GetUpdateReplicationProtectedItemProviderInput() *UpdateReplicationProtectedItemProviderInput -} - // UpdateReplicationProtectedItemProviderInput - Update replication protected item provider specific input. type UpdateReplicationProtectedItemProviderInput struct { // REQUIRED; The class type. @@ -11503,6 +10230,9 @@ type VMwareCbtEnableMigrationInput struct { // REQUIRED; The ARM Id of the VM discovered in VMware. VmwareMachineID *string + // The confidential VM key vault Id for ADE installation. + ConfidentialVMKeyVaultID *string + // License type. LicenseType *LicenseType @@ -11542,6 +10272,9 @@ type VMwareCbtEnableMigrationInput struct { // The target VM name. TargetVMName *string + // The target VM security profile. + TargetVMSecurityProfile *VMwareCbtSecurityProfileProperties + // The target VM size. TargetVMSize *string @@ -11586,6 +10319,9 @@ type VMwareCbtMigrateInput struct { // REQUIRED; A value indicating whether VM is to be shutdown. PerformShutdown *string + + // A value indicating the inplace OS Upgrade version. + OSUpgradeVersion *string } // GetMigrateProviderSpecificInput implements the MigrateProviderSpecificInputClassification interface for type VMwareCbtMigrateInput. @@ -11600,6 +10336,9 @@ type VMwareCbtMigrationDetails struct { // REQUIRED; Gets the instance type. InstanceType *string + // The confidential VM key vault Id for ADE installation. + ConfidentialVMKeyVaultID *string + // License Type of the VM to be used. LicenseType *string @@ -11615,6 +10354,9 @@ type VMwareCbtMigrationDetails struct { // The tags for the seed disks. SeedDiskTags map[string]*string + // A value indicating the inplace OS Upgrade version. + SupportedOSVersions []*string + // The target availability set Id. TargetAvailabilitySetID *string @@ -11642,6 +10384,9 @@ type VMwareCbtMigrationDetails struct { // Target VM name. TargetVMName *string + // The target VM security profile. + TargetVMSecurityProfile *VMwareCbtSecurityProfileProperties + // The target VM size. TargetVMSize *string @@ -11654,18 +10399,33 @@ type VMwareCbtMigrationDetails struct { // The network details. VMNics []*VMwareCbtNicDetails + // READ-ONLY; A value indicating the appliance monitoring details. + ApplianceMonitoringDetails *ApplianceMonitoringDetails + // READ-ONLY; The data mover run as account Id. DataMoverRunAsAccountID *string + // READ-ONLY; The delta sync progress percentage. + DeltaSyncProgressPercentage *int32 + + // READ-ONLY; The delta sync retry count. + DeltaSyncRetryCount *int64 + // READ-ONLY; The firmware type. FirmwareType *string + // READ-ONLY; A value indicating the gateway operation details. + GatewayOperationDetails *GatewayOperationDetails + // READ-ONLY; The initial seeding progress percentage. InitialSeedingProgressPercentage *int32 // READ-ONLY; The initial seeding retry count. InitialSeedingRetryCount *int64 + // READ-ONLY; A value indicating whether checksum resync cycle is in progress. + IsCheckSumResyncCycle *string + // READ-ONLY; The last recovery point Id. LastRecoveryPointID *string @@ -11678,9 +10438,15 @@ type VMwareCbtMigrationDetails struct { // READ-ONLY; The recovery point Id to which the VM was migrated. MigrationRecoveryPointID *string + // READ-ONLY; The name of the OS on the VM. + OSName *string + // READ-ONLY; The type of the OS on the VM. OSType *string + // READ-ONLY; A value indicating the SRS operation name. + OperationName *string + // READ-ONLY; The resume progress percentage. ResumeProgressPercentage *int32 @@ -11840,6 +10606,9 @@ type VMwareCbtProtectedDiskDetails struct { // READ-ONLY; The disk path. DiskPath *string + // READ-ONLY; A value indicating the gateway operation details. + GatewayOperationDetails *GatewayOperationDetails + // READ-ONLY; A value indicating whether the disk is the OS disk. IsOSDisk *string @@ -11867,6 +10636,9 @@ type VMwareCbtProtectionContainerMappingDetails struct { // REQUIRED; Gets the class type. Overridden in derived classes. InstanceType *string + // The SKUs to be excluded. + ExcludedSKUs []*string + // READ-ONLY; The target key vault ARM Id. KeyVaultID *string @@ -11930,6 +10702,24 @@ func (v *VMwareCbtResyncInput) GetResyncProviderSpecificInput() *ResyncProviderS } } +// VMwareCbtSecurityProfileProperties - VMwareCbt security profile input. +type VMwareCbtSecurityProfileProperties struct { + // A value indicating whether confidential compute encryption to be enabled. + IsTargetVMConfidentialEncryptionEnabled *string + + // A value indicating whether integrity monitoring to be enabled. + IsTargetVMIntegrityMonitoringEnabled *string + + // A value indicating whether secure boot to be enabled. + IsTargetVMSecureBootEnabled *string + + // A value indicating whether trusted platform module to be enabled. + IsTargetVMTpmEnabled *string + + // The target VM security type. + TargetVMSecurityType *SecurityType +} + // VMwareCbtTestMigrateInput - VMwareCbt specific test migrate input. type VMwareCbtTestMigrateInput struct { // REQUIRED; The class type. @@ -11941,6 +10731,9 @@ type VMwareCbtTestMigrateInput struct { // REQUIRED; The recovery point Id. RecoveryPointID *string + // A value indicating the inplace OS Upgrade version. + OSUpgradeVersion *string + // The list of NIC details. VMNics []*VMwareCbtNicInput } @@ -12354,8 +11147,8 @@ type VirtualMachineTaskDetails struct { // GetJobTaskDetails implements the JobTaskDetailsClassification interface for type VirtualMachineTaskDetails. func (v *VirtualMachineTaskDetails) GetJobTaskDetails() *JobTaskDetails { return &JobTaskDetails{ - JobTask: v.JobTask, InstanceType: v.InstanceType, + JobTask: v.JobTask, } } @@ -12505,15 +11298,15 @@ func (v *VmmVirtualMachineDetails) GetConfigurationSettings() *ConfigurationSett // GetHyperVVirtualMachineDetails implements the HyperVVirtualMachineDetailsClassification interface for type VmmVirtualMachineDetails. func (v *VmmVirtualMachineDetails) GetHyperVVirtualMachineDetails() *HyperVVirtualMachineDetails { return &HyperVVirtualMachineDetails{ - SourceItemID: v.SourceItemID, - Generation: v.Generation, - OSDetails: v.OSDetails, DiskDetails: v.DiskDetails, - HasPhysicalDisk: v.HasPhysicalDisk, + Generation: v.Generation, HasFibreChannelAdapter: v.HasFibreChannelAdapter, + HasPhysicalDisk: v.HasPhysicalDisk, HasSharedVhd: v.HasSharedVhd, HyperVHostID: v.HyperVHostID, InstanceType: v.InstanceType, + OSDetails: v.OSDetails, + SourceItemID: v.SourceItemID, } } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/models_serde.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/models_serde.go index 0efd5aa85e96..a3c3094b8fa9 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/models_serde.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/models_serde.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -607,6 +606,77 @@ func (a *A2AExtendedLocationDetails) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type A2AFabricSpecificLocationDetails. +func (a A2AFabricSpecificLocationDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "initialPrimaryExtendedLocation", a.InitialPrimaryExtendedLocation) + populate(objectMap, "initialPrimaryFabricLocation", a.InitialPrimaryFabricLocation) + populate(objectMap, "initialPrimaryZone", a.InitialPrimaryZone) + populate(objectMap, "initialRecoveryExtendedLocation", a.InitialRecoveryExtendedLocation) + populate(objectMap, "initialRecoveryFabricLocation", a.InitialRecoveryFabricLocation) + populate(objectMap, "initialRecoveryZone", a.InitialRecoveryZone) + populate(objectMap, "primaryExtendedLocation", a.PrimaryExtendedLocation) + populate(objectMap, "primaryFabricLocation", a.PrimaryFabricLocation) + populate(objectMap, "primaryZone", a.PrimaryZone) + populate(objectMap, "recoveryExtendedLocation", a.RecoveryExtendedLocation) + populate(objectMap, "recoveryFabricLocation", a.RecoveryFabricLocation) + populate(objectMap, "recoveryZone", a.RecoveryZone) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type A2AFabricSpecificLocationDetails. +func (a *A2AFabricSpecificLocationDetails) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "initialPrimaryExtendedLocation": + err = unpopulate(val, "InitialPrimaryExtendedLocation", &a.InitialPrimaryExtendedLocation) + delete(rawMsg, key) + case "initialPrimaryFabricLocation": + err = unpopulate(val, "InitialPrimaryFabricLocation", &a.InitialPrimaryFabricLocation) + delete(rawMsg, key) + case "initialPrimaryZone": + err = unpopulate(val, "InitialPrimaryZone", &a.InitialPrimaryZone) + delete(rawMsg, key) + case "initialRecoveryExtendedLocation": + err = unpopulate(val, "InitialRecoveryExtendedLocation", &a.InitialRecoveryExtendedLocation) + delete(rawMsg, key) + case "initialRecoveryFabricLocation": + err = unpopulate(val, "InitialRecoveryFabricLocation", &a.InitialRecoveryFabricLocation) + delete(rawMsg, key) + case "initialRecoveryZone": + err = unpopulate(val, "InitialRecoveryZone", &a.InitialRecoveryZone) + delete(rawMsg, key) + case "primaryExtendedLocation": + err = unpopulate(val, "PrimaryExtendedLocation", &a.PrimaryExtendedLocation) + delete(rawMsg, key) + case "primaryFabricLocation": + err = unpopulate(val, "PrimaryFabricLocation", &a.PrimaryFabricLocation) + delete(rawMsg, key) + case "primaryZone": + err = unpopulate(val, "PrimaryZone", &a.PrimaryZone) + delete(rawMsg, key) + case "recoveryExtendedLocation": + err = unpopulate(val, "RecoveryExtendedLocation", &a.RecoveryExtendedLocation) + delete(rawMsg, key) + case "recoveryFabricLocation": + err = unpopulate(val, "RecoveryFabricLocation", &a.RecoveryFabricLocation) + delete(rawMsg, key) + case "recoveryZone": + err = unpopulate(val, "RecoveryZone", &a.RecoveryZone) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type A2APolicyCreationInput. func (a A2APolicyCreationInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1157,6 +1227,7 @@ func (a A2AReplicationDetails) MarshalJSON() ([]byte, error) { populateTimeRFC3339(objectMap, "agentExpiryDate", a.AgentExpiryDate) populate(objectMap, "agentVersion", a.AgentVersion) populate(objectMap, "autoProtectionOfDataDisk", a.AutoProtectionOfDataDisk) + populate(objectMap, "churnOptionSelected", a.ChurnOptionSelected) populate(objectMap, "fabricObjectId", a.FabricObjectID) populate(objectMap, "initialPrimaryExtendedLocation", a.InitialPrimaryExtendedLocation) populate(objectMap, "initialPrimaryFabricLocation", a.InitialPrimaryFabricLocation) @@ -1231,6 +1302,9 @@ func (a *A2AReplicationDetails) UnmarshalJSON(data []byte) error { case "autoProtectionOfDataDisk": err = unpopulate(val, "AutoProtectionOfDataDisk", &a.AutoProtectionOfDataDisk) delete(rawMsg, key) + case "churnOptionSelected": + err = unpopulate(val, "ChurnOptionSelected", &a.ChurnOptionSelected) + delete(rawMsg, key) case "fabricObjectId": err = unpopulate(val, "FabricObjectID", &a.FabricObjectID) delete(rawMsg, key) @@ -2523,6 +2597,53 @@ func (a *ApplianceCollection) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ApplianceMonitoringDetails. +func (a ApplianceMonitoringDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cpuDetails", a.CPUDetails) + populate(objectMap, "datastoreSnapshot", a.DatastoreSnapshot) + populate(objectMap, "disksReplicationDetails", a.DisksReplicationDetails) + populate(objectMap, "esxiNfcBuffer", a.EsxiNfcBuffer) + populate(objectMap, "networkBandwidth", a.NetworkBandwidth) + populate(objectMap, "ramDetails", a.RAMDetails) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplianceMonitoringDetails. +func (a *ApplianceMonitoringDetails) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cpuDetails": + err = unpopulate(val, "CPUDetails", &a.CPUDetails) + delete(rawMsg, key) + case "datastoreSnapshot": + err = unpopulate(val, "DatastoreSnapshot", &a.DatastoreSnapshot) + delete(rawMsg, key) + case "disksReplicationDetails": + err = unpopulate(val, "DisksReplicationDetails", &a.DisksReplicationDetails) + delete(rawMsg, key) + case "esxiNfcBuffer": + err = unpopulate(val, "EsxiNfcBuffer", &a.EsxiNfcBuffer) + delete(rawMsg, key) + case "networkBandwidth": + err = unpopulate(val, "NetworkBandwidth", &a.NetworkBandwidth) + delete(rawMsg, key) + case "ramDetails": + err = unpopulate(val, "RAMDetails", &a.RAMDetails) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ApplianceQueryParameter. func (a ApplianceQueryParameter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2550,6 +2671,45 @@ func (a *ApplianceQueryParameter) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ApplianceResourceDetails. +func (a ApplianceResourceDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "capacity", a.Capacity) + populate(objectMap, "processUtilization", a.ProcessUtilization) + populate(objectMap, "status", a.Status) + populate(objectMap, "totalUtilization", a.TotalUtilization) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplianceResourceDetails. +func (a *ApplianceResourceDetails) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "capacity": + err = unpopulate(val, "Capacity", &a.Capacity) + delete(rawMsg, key) + case "processUtilization": + err = unpopulate(val, "ProcessUtilization", &a.ProcessUtilization) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &a.Status) + delete(rawMsg, key) + case "totalUtilization": + err = unpopulate(val, "TotalUtilization", &a.TotalUtilization) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ApplianceSpecificDetails. func (a ApplianceSpecificDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2794,6 +2954,7 @@ func (a AzureFabricSpecificDetails) MarshalJSON() ([]byte, error) { populate(objectMap, "extendedLocations", a.ExtendedLocations) objectMap["instanceType"] = "Azure" populate(objectMap, "location", a.Location) + populate(objectMap, "locationDetails", a.LocationDetails) populate(objectMap, "zones", a.Zones) return json.Marshal(objectMap) } @@ -2819,6 +2980,9 @@ func (a *AzureFabricSpecificDetails) UnmarshalJSON(data []byte) error { case "location": err = unpopulate(val, "Location", &a.Location) delete(rawMsg, key) + case "locationDetails": + err = unpopulate(val, "LocationDetails", &a.LocationDetails) + delete(rawMsg, key) case "zones": err = unpopulate(val, "Zones", &a.Zones) delete(rawMsg, key) @@ -3707,6 +3871,41 @@ func (d *DataStore) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DataStoreUtilizationDetails. +func (d DataStoreUtilizationDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dataStoreName", d.DataStoreName) + populate(objectMap, "totalSnapshotsCreated", d.TotalSnapshotsCreated) + populate(objectMap, "totalSnapshotsSupported", d.TotalSnapshotsSupported) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataStoreUtilizationDetails. +func (d *DataStoreUtilizationDetails) 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 "dataStoreName": + err = unpopulate(val, "DataStoreName", &d.DataStoreName) + delete(rawMsg, key) + case "totalSnapshotsCreated": + err = unpopulate(val, "TotalSnapshotsCreated", &d.TotalSnapshotsCreated) + delete(rawMsg, key) + case "totalSnapshotsSupported": + err = unpopulate(val, "TotalSnapshotsSupported", &d.TotalSnapshotsSupported) + 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 DisableProtectionInput. func (d DisableProtectionInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4991,8 +5190,10 @@ func (f FabricQueryParameter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "biosId", f.BiosID) populate(objectMap, "discoveryType", f.DiscoveryType) + populate(objectMap, "extendedLocationMappings", f.ExtendedLocationMappings) populate(objectMap, "fetchAgentDetails", f.FetchAgentDetails) populate(objectMap, "fqdn", f.Fqdn) + populate(objectMap, "locationDetails", f.LocationDetails) populate(objectMap, "osType", f.OSType) populate(objectMap, "zoneToZoneMappings", f.ZoneToZoneMappings) return json.Marshal(objectMap) @@ -5013,12 +5214,18 @@ func (f *FabricQueryParameter) UnmarshalJSON(data []byte) error { case "discoveryType": err = unpopulate(val, "DiscoveryType", &f.DiscoveryType) delete(rawMsg, key) + case "extendedLocationMappings": + err = unpopulate(val, "ExtendedLocationMappings", &f.ExtendedLocationMappings) + delete(rawMsg, key) case "fetchAgentDetails": err = unpopulate(val, "FetchAgentDetails", &f.FetchAgentDetails) delete(rawMsg, key) case "fqdn": err = unpopulate(val, "Fqdn", &f.Fqdn) delete(rawMsg, key) + case "locationDetails": + err = unpopulate(val, "LocationDetails", &f.LocationDetails) + delete(rawMsg, key) case "osType": err = unpopulate(val, "OSType", &f.OSType) delete(rawMsg, key) @@ -5344,6 +5551,61 @@ func (f *FailoverReplicationProtectedItemDetails) UnmarshalJSON(data []byte) err return nil } +// MarshalJSON implements the json.Marshaller interface for type GatewayOperationDetails. +func (g GatewayOperationDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dataStores", g.DataStores) + populate(objectMap, "hostName", g.HostName) + populate(objectMap, "progressPercentage", g.ProgressPercentage) + populate(objectMap, "state", g.State) + populate(objectMap, "timeElapsed", g.TimeElapsed) + populate(objectMap, "timeRemaining", g.TimeRemaining) + populate(objectMap, "uploadSpeed", g.UploadSpeed) + populate(objectMap, "vmwareReadThroughput", g.VmwareReadThroughput) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayOperationDetails. +func (g *GatewayOperationDetails) 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataStores": + err = unpopulate(val, "DataStores", &g.DataStores) + delete(rawMsg, key) + case "hostName": + err = unpopulate(val, "HostName", &g.HostName) + delete(rawMsg, key) + case "progressPercentage": + err = unpopulate(val, "ProgressPercentage", &g.ProgressPercentage) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &g.State) + delete(rawMsg, key) + case "timeElapsed": + err = unpopulate(val, "TimeElapsed", &g.TimeElapsed) + delete(rawMsg, key) + case "timeRemaining": + err = unpopulate(val, "TimeRemaining", &g.TimeRemaining) + delete(rawMsg, key) + case "uploadSpeed": + err = unpopulate(val, "UploadSpeed", &g.UploadSpeed) + delete(rawMsg, key) + case "vmwareReadThroughput": + err = unpopulate(val, "VmwareReadThroughput", &g.VmwareReadThroughput) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type GroupTaskDetails. func (g GroupTaskDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5964,6 +6226,7 @@ func (h *HyperVReplicaAzureManagedDiskDetails) UnmarshalJSON(data []byte) error func (h HyperVReplicaAzurePlannedFailoverProviderInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["instanceType"] = "HyperVReplicaAzure" + populate(objectMap, "osUpgradeVersion", h.OSUpgradeVersion) populate(objectMap, "primaryKekCertificatePfx", h.PrimaryKekCertificatePfx) populate(objectMap, "recoveryPointId", h.RecoveryPointID) populate(objectMap, "secondaryKekCertificatePfx", h.SecondaryKekCertificatePfx) @@ -5982,6 +6245,9 @@ func (h *HyperVReplicaAzurePlannedFailoverProviderInput) UnmarshalJSON(data []by case "instanceType": err = unpopulate(val, "InstanceType", &h.InstanceType) delete(rawMsg, key) + case "osUpgradeVersion": + err = unpopulate(val, "OSUpgradeVersion", &h.OSUpgradeVersion) + delete(rawMsg, key) case "primaryKekCertificatePfx": err = unpopulate(val, "PrimaryKekCertificatePfx", &h.PrimaryKekCertificatePfx) delete(rawMsg, key) @@ -6100,6 +6366,7 @@ func (h *HyperVReplicaAzurePolicyInput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type HyperVReplicaAzureReplicationDetails. func (h HyperVReplicaAzureReplicationDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "allAvailableOSUpgradeConfigurations", h.AllAvailableOSUpgradeConfigurations) populate(objectMap, "azureVmDiskDetails", h.AzureVMDiskDetails) populate(objectMap, "enableRdpOnTargetOption", h.EnableRdpOnTargetOption) populate(objectMap, "encryption", h.Encryption) @@ -6146,6 +6413,9 @@ func (h *HyperVReplicaAzureReplicationDetails) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { + case "allAvailableOSUpgradeConfigurations": + err = unpopulate(val, "AllAvailableOSUpgradeConfigurations", &h.AllAvailableOSUpgradeConfigurations) + delete(rawMsg, key) case "azureVmDiskDetails": err = unpopulate(val, "AzureVMDiskDetails", &h.AzureVMDiskDetails) delete(rawMsg, key) @@ -6311,6 +6581,7 @@ func (h *HyperVReplicaAzureReprotectInput) UnmarshalJSON(data []byte) error { func (h HyperVReplicaAzureTestFailoverInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["instanceType"] = "HyperVReplicaAzure" + populate(objectMap, "osUpgradeVersion", h.OSUpgradeVersion) populate(objectMap, "primaryKekCertificatePfx", h.PrimaryKekCertificatePfx) populate(objectMap, "recoveryPointId", h.RecoveryPointID) populate(objectMap, "secondaryKekCertificatePfx", h.SecondaryKekCertificatePfx) @@ -6329,6 +6600,9 @@ func (h *HyperVReplicaAzureTestFailoverInput) UnmarshalJSON(data []byte) error { case "instanceType": err = unpopulate(val, "InstanceType", &h.InstanceType) delete(rawMsg, key) + case "osUpgradeVersion": + err = unpopulate(val, "OSUpgradeVersion", &h.OSUpgradeVersion) + delete(rawMsg, key) case "primaryKekCertificatePfx": err = unpopulate(val, "PrimaryKekCertificatePfx", &h.PrimaryKekCertificatePfx) delete(rawMsg, key) @@ -7912,6 +8186,7 @@ func (i InMageAzureV2ReplicationDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "agentExpiryDate", i.AgentExpiryDate) populate(objectMap, "agentVersion", i.AgentVersion) + populate(objectMap, "allAvailableOSUpgradeConfigurations", i.AllAvailableOSUpgradeConfigurations) populate(objectMap, "azureVMDiskDetails", i.AzureVMDiskDetails) populate(objectMap, "azureVmGeneration", i.AzureVMGeneration) populate(objectMap, "compressedDataRateInMB", i.CompressedDataRateInMB) @@ -7936,6 +8211,7 @@ func (i InMageAzureV2ReplicationDetails) MarshalJSON() ([]byte, error) { populate(objectMap, "multiVmGroupName", i.MultiVMGroupName) populate(objectMap, "multiVmSyncStatus", i.MultiVMSyncStatus) populate(objectMap, "osDiskId", i.OSDiskID) + populate(objectMap, "osName", i.OSName) populate(objectMap, "osType", i.OSType) populate(objectMap, "osVersion", i.OSVersion) populate(objectMap, "processServerId", i.ProcessServerID) @@ -7959,6 +8235,7 @@ func (i InMageAzureV2ReplicationDetails) MarshalJSON() ([]byte, error) { populate(objectMap, "selectedTfoAzureNetworkId", i.SelectedTfoAzureNetworkID) populate(objectMap, "sourceVmCpuCount", i.SourceVMCPUCount) populate(objectMap, "sourceVmRamSizeInMB", i.SourceVMRAMSizeInMB) + populate(objectMap, "supportedOSVersions", i.SupportedOSVersions) populate(objectMap, "switchProviderBlockingErrorDetails", i.SwitchProviderBlockingErrorDetails) populate(objectMap, "switchProviderDetails", i.SwitchProviderDetails) populate(objectMap, "targetAvailabilityZone", i.TargetAvailabilityZone) @@ -7996,6 +8273,9 @@ func (i *InMageAzureV2ReplicationDetails) UnmarshalJSON(data []byte) error { case "agentVersion": err = unpopulate(val, "AgentVersion", &i.AgentVersion) delete(rawMsg, key) + case "allAvailableOSUpgradeConfigurations": + err = unpopulate(val, "AllAvailableOSUpgradeConfigurations", &i.AllAvailableOSUpgradeConfigurations) + delete(rawMsg, key) case "azureVMDiskDetails": err = unpopulate(val, "AzureVMDiskDetails", &i.AzureVMDiskDetails) delete(rawMsg, key) @@ -8068,6 +8348,9 @@ func (i *InMageAzureV2ReplicationDetails) UnmarshalJSON(data []byte) error { case "osDiskId": err = unpopulate(val, "OSDiskID", &i.OSDiskID) delete(rawMsg, key) + case "osName": + err = unpopulate(val, "OSName", &i.OSName) + delete(rawMsg, key) case "osType": err = unpopulate(val, "OSType", &i.OSType) delete(rawMsg, key) @@ -8137,6 +8420,9 @@ func (i *InMageAzureV2ReplicationDetails) UnmarshalJSON(data []byte) error { case "sourceVmRamSizeInMB": err = unpopulate(val, "SourceVMRAMSizeInMB", &i.SourceVMRAMSizeInMB) delete(rawMsg, key) + case "supportedOSVersions": + err = unpopulate(val, "SupportedOSVersions", &i.SupportedOSVersions) + delete(rawMsg, key) case "switchProviderBlockingErrorDetails": err = unpopulate(val, "SwitchProviderBlockingErrorDetails", &i.SwitchProviderBlockingErrorDetails) delete(rawMsg, key) @@ -8386,6 +8672,7 @@ func (i *InMageAzureV2SwitchProviderInput) UnmarshalJSON(data []byte) error { func (i InMageAzureV2TestFailoverInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["instanceType"] = "InMageAzureV2" + populate(objectMap, "osUpgradeVersion", i.OSUpgradeVersion) populate(objectMap, "recoveryPointId", i.RecoveryPointID) return json.Marshal(objectMap) } @@ -8402,6 +8689,9 @@ func (i *InMageAzureV2TestFailoverInput) UnmarshalJSON(data []byte) error { case "instanceType": err = unpopulate(val, "InstanceType", &i.InstanceType) delete(rawMsg, key) + case "osUpgradeVersion": + err = unpopulate(val, "OSUpgradeVersion", &i.OSUpgradeVersion) + delete(rawMsg, key) case "recoveryPointId": err = unpopulate(val, "RecoveryPointID", &i.RecoveryPointID) delete(rawMsg, key) @@ -8417,6 +8707,7 @@ func (i *InMageAzureV2TestFailoverInput) UnmarshalJSON(data []byte) error { func (i InMageAzureV2UnplannedFailoverInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["instanceType"] = "InMageAzureV2" + populate(objectMap, "osUpgradeVersion", i.OSUpgradeVersion) populate(objectMap, "recoveryPointId", i.RecoveryPointID) return json.Marshal(objectMap) } @@ -8433,6 +8724,9 @@ func (i *InMageAzureV2UnplannedFailoverInput) UnmarshalJSON(data []byte) error { case "instanceType": err = unpopulate(val, "InstanceType", &i.InstanceType) delete(rawMsg, key) + case "osUpgradeVersion": + err = unpopulate(val, "OSUpgradeVersion", &i.OSUpgradeVersion) + delete(rawMsg, key) case "recoveryPointId": err = unpopulate(val, "RecoveryPointID", &i.RecoveryPointID) delete(rawMsg, key) @@ -13488,6 +13782,37 @@ func (o *OSDiskDetails) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type OSUpgradeSupportedVersions. +func (o OSUpgradeSupportedVersions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "supportedSourceOsVersion", o.SupportedSourceOsVersion) + populate(objectMap, "supportedTargetOsVersions", o.SupportedTargetOsVersions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OSUpgradeSupportedVersions. +func (o *OSUpgradeSupportedVersions) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "supportedSourceOsVersion": + err = unpopulate(val, "SupportedSourceOsVersion", &o.SupportedSourceOsVersion) + delete(rawMsg, key) + case "supportedTargetOsVersions": + err = unpopulate(val, "SupportedTargetOsVersions", &o.SupportedTargetOsVersions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type OSVersionWrapper. func (o OSVersionWrapper) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -20573,6 +20898,7 @@ func (v *VMwareCbtDiskInput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VMwareCbtEnableMigrationInput. func (v VMwareCbtEnableMigrationInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "confidentialVmKeyVaultId", v.ConfidentialVMKeyVaultID) populate(objectMap, "dataMoverRunAsAccountId", v.DataMoverRunAsAccountID) populate(objectMap, "disksToInclude", v.DisksToInclude) objectMap["instanceType"] = "VMwareCbt" @@ -20592,6 +20918,7 @@ func (v VMwareCbtEnableMigrationInput) MarshalJSON() ([]byte, error) { populate(objectMap, "targetResourceGroupId", v.TargetResourceGroupID) populate(objectMap, "targetSubnetName", v.TargetSubnetName) populate(objectMap, "targetVmName", v.TargetVMName) + populate(objectMap, "targetVmSecurityProfile", v.TargetVMSecurityProfile) populate(objectMap, "targetVmSize", v.TargetVMSize) populate(objectMap, "targetVmTags", v.TargetVMTags) populate(objectMap, "testNetworkId", v.TestNetworkID) @@ -20609,6 +20936,9 @@ func (v *VMwareCbtEnableMigrationInput) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "confidentialVmKeyVaultId": + err = unpopulate(val, "ConfidentialVMKeyVaultID", &v.ConfidentialVMKeyVaultID) + delete(rawMsg, key) case "dataMoverRunAsAccountId": err = unpopulate(val, "DataMoverRunAsAccountID", &v.DataMoverRunAsAccountID) delete(rawMsg, key) @@ -20666,6 +20996,9 @@ func (v *VMwareCbtEnableMigrationInput) UnmarshalJSON(data []byte) error { case "targetVmName": err = unpopulate(val, "TargetVMName", &v.TargetVMName) delete(rawMsg, key) + case "targetVmSecurityProfile": + err = unpopulate(val, "TargetVMSecurityProfile", &v.TargetVMSecurityProfile) + delete(rawMsg, key) case "targetVmSize": err = unpopulate(val, "TargetVMSize", &v.TargetVMSize) delete(rawMsg, key) @@ -20724,6 +21057,7 @@ func (v *VMwareCbtEventDetails) UnmarshalJSON(data []byte) error { func (v VMwareCbtMigrateInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["instanceType"] = "VMwareCbt" + populate(objectMap, "osUpgradeVersion", v.OSUpgradeVersion) populate(objectMap, "performShutdown", v.PerformShutdown) return json.Marshal(objectMap) } @@ -20740,6 +21074,9 @@ func (v *VMwareCbtMigrateInput) UnmarshalJSON(data []byte) error { case "instanceType": err = unpopulate(val, "InstanceType", &v.InstanceType) delete(rawMsg, key) + case "osUpgradeVersion": + err = unpopulate(val, "OSUpgradeVersion", &v.OSUpgradeVersion) + delete(rawMsg, key) case "performShutdown": err = unpopulate(val, "PerformShutdown", &v.PerformShutdown) delete(rawMsg, key) @@ -20754,17 +21091,25 @@ func (v *VMwareCbtMigrateInput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VMwareCbtMigrationDetails. func (v VMwareCbtMigrationDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "applianceMonitoringDetails", v.ApplianceMonitoringDetails) + populate(objectMap, "confidentialVmKeyVaultId", v.ConfidentialVMKeyVaultID) populate(objectMap, "dataMoverRunAsAccountId", v.DataMoverRunAsAccountID) + populate(objectMap, "deltaSyncProgressPercentage", v.DeltaSyncProgressPercentage) + populate(objectMap, "deltaSyncRetryCount", v.DeltaSyncRetryCount) populate(objectMap, "firmwareType", v.FirmwareType) + populate(objectMap, "gatewayOperationDetails", v.GatewayOperationDetails) populate(objectMap, "initialSeedingProgressPercentage", v.InitialSeedingProgressPercentage) populate(objectMap, "initialSeedingRetryCount", v.InitialSeedingRetryCount) objectMap["instanceType"] = "VMwareCbt" + populate(objectMap, "isCheckSumResyncCycle", v.IsCheckSumResyncCycle) populate(objectMap, "lastRecoveryPointId", v.LastRecoveryPointID) populateTimeRFC3339(objectMap, "lastRecoveryPointReceived", v.LastRecoveryPointReceived) populate(objectMap, "licenseType", v.LicenseType) populate(objectMap, "migrationProgressPercentage", v.MigrationProgressPercentage) populate(objectMap, "migrationRecoveryPointId", v.MigrationRecoveryPointID) + populate(objectMap, "osName", v.OSName) populate(objectMap, "osType", v.OSType) + populate(objectMap, "operationName", v.OperationName) populate(objectMap, "performAutoResync", v.PerformAutoResync) populate(objectMap, "protectedDisks", v.ProtectedDisks) populate(objectMap, "resumeProgressPercentage", v.ResumeProgressPercentage) @@ -20777,6 +21122,7 @@ func (v VMwareCbtMigrationDetails) MarshalJSON() ([]byte, error) { populate(objectMap, "seedDiskTags", v.SeedDiskTags) populate(objectMap, "snapshotRunAsAccountId", v.SnapshotRunAsAccountID) populate(objectMap, "storageAccountId", v.StorageAccountID) + populate(objectMap, "supportedOSVersions", v.SupportedOSVersions) populate(objectMap, "targetAvailabilitySetId", v.TargetAvailabilitySetID) populate(objectMap, "targetAvailabilityZone", v.TargetAvailabilityZone) populate(objectMap, "targetBootDiagnosticsStorageAccountId", v.TargetBootDiagnosticsStorageAccountID) @@ -20788,6 +21134,7 @@ func (v VMwareCbtMigrationDetails) MarshalJSON() ([]byte, error) { populate(objectMap, "targetProximityPlacementGroupId", v.TargetProximityPlacementGroupID) populate(objectMap, "targetResourceGroupId", v.TargetResourceGroupID) populate(objectMap, "targetVmName", v.TargetVMName) + populate(objectMap, "targetVmSecurityProfile", v.TargetVMSecurityProfile) populate(objectMap, "targetVmSize", v.TargetVMSize) populate(objectMap, "targetVmTags", v.TargetVMTags) populate(objectMap, "testNetworkId", v.TestNetworkID) @@ -20805,12 +21152,27 @@ func (v *VMwareCbtMigrationDetails) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "applianceMonitoringDetails": + err = unpopulate(val, "ApplianceMonitoringDetails", &v.ApplianceMonitoringDetails) + delete(rawMsg, key) + case "confidentialVmKeyVaultId": + err = unpopulate(val, "ConfidentialVMKeyVaultID", &v.ConfidentialVMKeyVaultID) + delete(rawMsg, key) case "dataMoverRunAsAccountId": err = unpopulate(val, "DataMoverRunAsAccountID", &v.DataMoverRunAsAccountID) delete(rawMsg, key) + case "deltaSyncProgressPercentage": + err = unpopulate(val, "DeltaSyncProgressPercentage", &v.DeltaSyncProgressPercentage) + delete(rawMsg, key) + case "deltaSyncRetryCount": + err = unpopulate(val, "DeltaSyncRetryCount", &v.DeltaSyncRetryCount) + delete(rawMsg, key) case "firmwareType": err = unpopulate(val, "FirmwareType", &v.FirmwareType) delete(rawMsg, key) + case "gatewayOperationDetails": + err = unpopulate(val, "GatewayOperationDetails", &v.GatewayOperationDetails) + delete(rawMsg, key) case "initialSeedingProgressPercentage": err = unpopulate(val, "InitialSeedingProgressPercentage", &v.InitialSeedingProgressPercentage) delete(rawMsg, key) @@ -20820,6 +21182,9 @@ func (v *VMwareCbtMigrationDetails) UnmarshalJSON(data []byte) error { case "instanceType": err = unpopulate(val, "InstanceType", &v.InstanceType) delete(rawMsg, key) + case "isCheckSumResyncCycle": + err = unpopulate(val, "IsCheckSumResyncCycle", &v.IsCheckSumResyncCycle) + delete(rawMsg, key) case "lastRecoveryPointId": err = unpopulate(val, "LastRecoveryPointID", &v.LastRecoveryPointID) delete(rawMsg, key) @@ -20835,9 +21200,15 @@ func (v *VMwareCbtMigrationDetails) UnmarshalJSON(data []byte) error { case "migrationRecoveryPointId": err = unpopulate(val, "MigrationRecoveryPointID", &v.MigrationRecoveryPointID) delete(rawMsg, key) + case "osName": + err = unpopulate(val, "OSName", &v.OSName) + delete(rawMsg, key) case "osType": err = unpopulate(val, "OSType", &v.OSType) delete(rawMsg, key) + case "operationName": + err = unpopulate(val, "OperationName", &v.OperationName) + delete(rawMsg, key) case "performAutoResync": err = unpopulate(val, "PerformAutoResync", &v.PerformAutoResync) delete(rawMsg, key) @@ -20874,6 +21245,9 @@ func (v *VMwareCbtMigrationDetails) UnmarshalJSON(data []byte) error { case "storageAccountId": err = unpopulate(val, "StorageAccountID", &v.StorageAccountID) delete(rawMsg, key) + case "supportedOSVersions": + err = unpopulate(val, "SupportedOSVersions", &v.SupportedOSVersions) + delete(rawMsg, key) case "targetAvailabilitySetId": err = unpopulate(val, "TargetAvailabilitySetID", &v.TargetAvailabilitySetID) delete(rawMsg, key) @@ -20907,6 +21281,9 @@ func (v *VMwareCbtMigrationDetails) UnmarshalJSON(data []byte) error { case "targetVmName": err = unpopulate(val, "TargetVMName", &v.TargetVMName) delete(rawMsg, key) + case "targetVmSecurityProfile": + err = unpopulate(val, "TargetVMSecurityProfile", &v.TargetVMSecurityProfile) + delete(rawMsg, key) case "targetVmSize": err = unpopulate(val, "TargetVMSize", &v.TargetVMSize) delete(rawMsg, key) @@ -21112,6 +21489,7 @@ func (v VMwareCbtProtectedDiskDetails) MarshalJSON() ([]byte, error) { populate(objectMap, "diskName", v.DiskName) populate(objectMap, "diskPath", v.DiskPath) populate(objectMap, "diskType", v.DiskType) + populate(objectMap, "gatewayOperationDetails", v.GatewayOperationDetails) populate(objectMap, "isOSDisk", v.IsOSDisk) populate(objectMap, "logStorageAccountId", v.LogStorageAccountID) populate(objectMap, "logStorageAccountSasSecretName", v.LogStorageAccountSasSecretName) @@ -21150,6 +21528,9 @@ func (v *VMwareCbtProtectedDiskDetails) UnmarshalJSON(data []byte) error { case "diskType": err = unpopulate(val, "DiskType", &v.DiskType) delete(rawMsg, key) + case "gatewayOperationDetails": + err = unpopulate(val, "GatewayOperationDetails", &v.GatewayOperationDetails) + delete(rawMsg, key) case "isOSDisk": err = unpopulate(val, "IsOSDisk", &v.IsOSDisk) delete(rawMsg, key) @@ -21185,6 +21566,7 @@ func (v *VMwareCbtProtectedDiskDetails) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VMwareCbtProtectionContainerMappingDetails. func (v VMwareCbtProtectionContainerMappingDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "excludedSkus", v.ExcludedSKUs) objectMap["instanceType"] = "VMwareCbt" populate(objectMap, "keyVaultId", v.KeyVaultID) populate(objectMap, "keyVaultUri", v.KeyVaultURI) @@ -21205,6 +21587,9 @@ func (v *VMwareCbtProtectionContainerMappingDetails) UnmarshalJSON(data []byte) for key, val := range rawMsg { var err error switch key { + case "excludedSkus": + err = unpopulate(val, "ExcludedSKUs", &v.ExcludedSKUs) + delete(rawMsg, key) case "instanceType": err = unpopulate(val, "InstanceType", &v.InstanceType) delete(rawMsg, key) @@ -21299,11 +21684,55 @@ func (v *VMwareCbtResyncInput) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type VMwareCbtSecurityProfileProperties. +func (v VMwareCbtSecurityProfileProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "isTargetVmConfidentialEncryptionEnabled", v.IsTargetVMConfidentialEncryptionEnabled) + populate(objectMap, "isTargetVmIntegrityMonitoringEnabled", v.IsTargetVMIntegrityMonitoringEnabled) + populate(objectMap, "isTargetVmSecureBootEnabled", v.IsTargetVMSecureBootEnabled) + populate(objectMap, "isTargetVmTpmEnabled", v.IsTargetVMTpmEnabled) + populate(objectMap, "targetVmSecurityType", v.TargetVMSecurityType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VMwareCbtSecurityProfileProperties. +func (v *VMwareCbtSecurityProfileProperties) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "isTargetVmConfidentialEncryptionEnabled": + err = unpopulate(val, "IsTargetVMConfidentialEncryptionEnabled", &v.IsTargetVMConfidentialEncryptionEnabled) + delete(rawMsg, key) + case "isTargetVmIntegrityMonitoringEnabled": + err = unpopulate(val, "IsTargetVMIntegrityMonitoringEnabled", &v.IsTargetVMIntegrityMonitoringEnabled) + delete(rawMsg, key) + case "isTargetVmSecureBootEnabled": + err = unpopulate(val, "IsTargetVMSecureBootEnabled", &v.IsTargetVMSecureBootEnabled) + delete(rawMsg, key) + case "isTargetVmTpmEnabled": + err = unpopulate(val, "IsTargetVMTpmEnabled", &v.IsTargetVMTpmEnabled) + delete(rawMsg, key) + case "targetVmSecurityType": + err = unpopulate(val, "TargetVMSecurityType", &v.TargetVMSecurityType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type VMwareCbtTestMigrateInput. func (v VMwareCbtTestMigrateInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["instanceType"] = "VMwareCbt" populate(objectMap, "networkId", v.NetworkID) + populate(objectMap, "osUpgradeVersion", v.OSUpgradeVersion) populate(objectMap, "recoveryPointId", v.RecoveryPointID) populate(objectMap, "vmNics", v.VMNics) return json.Marshal(objectMap) @@ -21324,6 +21753,9 @@ func (v *VMwareCbtTestMigrateInput) UnmarshalJSON(data []byte) error { case "networkId": err = unpopulate(val, "NetworkID", &v.NetworkID) delete(rawMsg, key) + case "osUpgradeVersion": + err = unpopulate(val, "OSUpgradeVersion", &v.OSUpgradeVersion) + delete(rawMsg, key) case "recoveryPointId": err = unpopulate(val, "RecoveryPointID", &v.RecoveryPointID) delete(rawMsg, key) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/operations_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/operations_client.go index c297dd38b743..1a9c01d60667 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/operations_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/operations_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -46,7 +45,7 @@ func NewOperationsClient(subscriptionID string, credential azcore.TokenCredentia // NewListPager - Operation to return the list of available operations. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(resourceGroupName string, options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { @@ -93,7 +92,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/operations_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/operations_client_example_test.go deleted file mode 100644 index 17b253dd9555..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/operations_client_example_test.go +++ /dev/null @@ -1,1256 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/Operations_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager("resourceGroupPS1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationsDiscoveryCollection = armrecoveryservicessiterecovery.OperationsDiscoveryCollection{ - // Value: []*armrecoveryservicessiterecovery.OperationsDiscovery{ - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/vaultTokens/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("The Vault Token operation can be used to get Vault Token for vault level backend operations."), - // Operation: to.Ptr("Vault Token"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Vaults"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/registeredIdentities/write"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("The Register Service Container operation can be used to register a container with Recovery Service."), - // Operation: to.Ptr("Register Service Container"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Vaults"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/registeredIdentities/operationResults/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("The Get Operation Results operation can be used get the operation status and result for the asynchronously submitted operation"), - // Operation: to.Ptr("Get Operation Results"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Vaults"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/registeredIdentities/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("The Get Containers operation can be used get the containers registered for a resource."), - // Operation: to.Ptr("Get Containers"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Vaults"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/registeredIdentities/delete"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("The UnRegister Container operation can be used to unregister a container."), - // Operation: to.Ptr("Unregister Service Container"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Vaults"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/certificates/write"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("The Update Resource Certificate operation updates the resource/vault credential certificate."), - // Operation: to.Ptr("Update Resource Certificate"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Vaults"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationAlertSettings/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Read Any Alerts Settings"), - // Operation: to.Ptr("Read Alerts Settings"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Alerts Settings"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationAlertSettings/write"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Create or Update Any Alerts Settings"), - // Operation: to.Ptr("Create or Update Alerts Settings"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Alerts Settings"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationEvents/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Read Any Events"), - // Operation: to.Ptr("Read Events"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Events"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationNetworks/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Read Any Networks"), - // Operation: to.Ptr("Read Networks"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Networks"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationNetworks/replicationNetworkMappings/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Read Any Network Mappings"), - // Operation: to.Ptr("Read Network Mappings"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Network Mappings"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationNetworks/replicationNetworkMappings/write"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Create or Update Any Network Mappings"), - // Operation: to.Ptr("Create or Update Network Mappings"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Network Mappings"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationNetworks/replicationNetworkMappings/delete"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Delete Any Network Mappings"), - // Operation: to.Ptr("Delete Network Mappings"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Network Mappings"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectableItems/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Read Any Protectable Items"), - // Operation: to.Ptr("Read Protectable Items"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Protectable Items"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectionContainerMappings/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Read Any Protection Container Mappings"), - // Operation: to.Ptr("Read Protection Container Mappings"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Protection Container Mappings"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectionContainerMappings/write"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Create or Update Any Protection Container Mappings"), - // Operation: to.Ptr("Create or Update Protection Container Mappings"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Protection Container Mappings"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectionContainerMappings/remove/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Remove Protection Container Mapping"), - // Operation: to.Ptr("Remove Protection Container Mapping"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Protection Container Mappings"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectionContainerMappings/delete"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Delete Any Protection Container Mappings"), - // Operation: to.Ptr("Delete Protection Container Mappings"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Protection Container Mappings"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/recoveryPoints/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Read Any Replication Recovery Points"), - // Operation: to.Ptr("Read Replication Recovery Points"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Replication Recovery Points"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Read Any Protected Items"), - // Operation: to.Ptr("Read Protected Items"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/write"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Create or Update Any Protected Items"), - // Operation: to.Ptr("Create or Update Protected Items"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/delete"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Delete Any Protected Items"), - // Operation: to.Ptr("Delete Protected Items"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/remove/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Remove Protected Item"), - // Operation: to.Ptr("Remove Protected Item"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/plannedFailover/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Planned Failover"), - // Operation: to.Ptr("Planned Failover"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/unplannedFailover/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Failover"), - // Operation: to.Ptr("Failover"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/testFailover/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Test Failover"), - // Operation: to.Ptr("Test Failover"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/testFailoverCleanup/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Test Failover Cleanup"), - // Operation: to.Ptr("Test Failover Cleanup"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/failoverCommit/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Failover Commit"), - // Operation: to.Ptr("Failover Commit"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/reProtect/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("ReProtect Protected Item"), - // Operation: to.Ptr("ReProtect Protected Item"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/updateMobilityService/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Update Mobility Service"), - // Operation: to.Ptr("Update Mobility Service"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/repairReplication/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Repair replication"), - // Operation: to.Ptr("Repair replication"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/applyRecoveryPoint/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Apply Recovery Point"), - // Operation: to.Ptr("Apply Recovery Point"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationJobs/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Read Any Jobs"), - // Operation: to.Ptr("Read Jobs"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Jobs"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationJobs/cancel/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Cancel Job"), - // Operation: to.Ptr("Cancel Job"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Jobs"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationJobs/restart/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Restart job"), - // Operation: to.Ptr("Restart job"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Jobs"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationJobs/resume/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Resume Job"), - // Operation: to.Ptr("Resume Job"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Jobs"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Read Any Protection Containers"), - // Operation: to.Ptr("Read Protection Containers"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Protection Containers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/discoverProtectableItem/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Discover Protectable Item"), - // Operation: to.Ptr("Discover Protectable Item"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Protection Containers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/write"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Create or Update Any Protection Containers"), - // Operation: to.Ptr("Create or Update Protection Containers"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Protection Containers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/remove/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Remove Protection Container"), - // Operation: to.Ptr("Remove Protection Container"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Protection Containers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/switchprotection/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Switch Protection Container"), - // Operation: to.Ptr("Switch Protection Container"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Protection Containers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationPolicies/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Read Any Policies"), - // Operation: to.Ptr("Read Policies"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Policies"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationPolicies/write"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Create or Update Any Policies"), - // Operation: to.Ptr("Create or Update Policies"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Policies"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationPolicies/delete"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Delete Any Policies"), - // Operation: to.Ptr("Delete Policies"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Policies"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Read Any Recovery Plans"), - // Operation: to.Ptr("Read Recovery Plans"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Recovery Plans"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/write"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Create or Update Any Recovery Plans"), - // Operation: to.Ptr("Create or Update Recovery Plans"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Recovery Plans"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/delete"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Delete Any Recovery Plans"), - // Operation: to.Ptr("Delete Recovery Plans"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Recovery Plans"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/plannedFailover/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Planned Failover Recovery Plan"), - // Operation: to.Ptr("Planned Failover Recovery Plan"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Recovery Plans"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/unplannedFailover/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Failover Recovery Plan"), - // Operation: to.Ptr("Failover Recovery Plan"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Recovery Plans"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/testFailover/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Test Failover Recovery Plan"), - // Operation: to.Ptr("Test Failover Recovery Plan"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Recovery Plans"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/testFailoverCleanup/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Test Failover Cleanup Recovery Plan"), - // Operation: to.Ptr("Test Failover Cleanup Recovery Plan"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Recovery Plans"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/failoverCommit/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Failover Commit Recovery Plan"), - // Operation: to.Ptr("Failover Commit Recovery Plan"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Recovery Plans"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationRecoveryPlans/reProtect/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("ReProtect Recovery Plan"), - // Operation: to.Ptr("ReProtect Recovery Plan"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Recovery Plans"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationRecoveryServicesProviders/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Read Any Recovery Services Providers"), - // Operation: to.Ptr("Read Recovery Services Providers"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Recovery Services Providers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationRecoveryServicesProviders/remove/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Remove Recovery Services Provider"), - // Operation: to.Ptr("Remove Recovery Services Provider"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Recovery Services Providers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationRecoveryServicesProviders/delete"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Delete Any Recovery Services Providers"), - // Operation: to.Ptr("Delete Recovery Services Providers"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Recovery Services Providers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationRecoveryServicesProviders/refreshProvider/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Refresh Provider"), - // Operation: to.Ptr("Refresh Provider"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Recovery Services Providers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Read Any Fabrics"), - // Operation: to.Ptr("Read Fabrics"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Fabrics"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/write"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Create or Update Any Fabrics"), - // Operation: to.Ptr("Create or Update Fabrics"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Fabrics"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/remove/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Remove Fabric"), - // Operation: to.Ptr("Remove Fabric"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Fabrics"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/checkConsistency/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Checks Consistency of the Fabric"), - // Operation: to.Ptr("Checks Consistency of the Fabric"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Fabrics"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/delete"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Delete Any Fabrics"), - // Operation: to.Ptr("Delete Fabrics"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Fabrics"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/renewcertificate/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Renew Certificate for Fabric"), - // Operation: to.Ptr("Renew Certificate for Fabric"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Fabrics"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/deployProcessServerImage/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Deploy Process Server Image"), - // Operation: to.Ptr("Deploy Process Server Image"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Fabrics"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/reassociateGateway/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Reassociate Gateway"), - // Operation: to.Ptr("Reassociate Gateway"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Fabrics"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationStorageClassifications/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Read Any Storage Classifications"), - // Operation: to.Ptr("Read Storage Classifications"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Storage Classifications"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationStorageClassifications/replicationStorageClassificationMappings/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Read Any Storage Classification Mappings"), - // Operation: to.Ptr("Read Storage Classification Mappings"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Storage Classification Mappings"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationStorageClassifications/replicationStorageClassificationMappings/write"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Create or Update Any Storage Classification Mappings"), - // Operation: to.Ptr("Create or Update Storage Classification Mappings"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Storage Classification Mappings"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationStorageClassifications/replicationStorageClassificationMappings/delete"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Delete Any Storage Classification Mappings"), - // Operation: to.Ptr("Delete Storage Classification Mappings"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Storage Classification Mappings"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/usages/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Read Any Vault Usages"), - // Operation: to.Ptr("Read Vault Usages"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Vault Usages"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationvCenters/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Read Any Jobs"), - // Operation: to.Ptr("Read Jobs"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Jobs"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationvCenters/write"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Create or Update Any Jobs"), - // Operation: to.Ptr("Create or Update Jobs"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Jobs"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationvCenters/delete"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Delete Any Jobs"), - // Operation: to.Ptr("Delete Jobs"), - // Provider: to.Ptr("Microsoft Recovery Services"), - // Resource: to.Ptr("Jobs"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/usages/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Returns usage details for a Recovery Services Vault."), - // Operation: to.Ptr("Recovery Services Vault usage details."), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Vault Usage"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupUsageSummaries/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Returns summaries for Protected Items and Protected Servers for a Recovery Services ."), - // Operation: to.Ptr("Recovery Services Protected Items and Protected Servers usage summaries details."), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Backup Usages Summaries"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/storageConfig/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Returns Storage Configuration for Recovery Services Vault."), - // Operation: to.Ptr("Get Resource Storage Config"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Vault Storage Config"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/storageConfig/write"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Updates Storage Configuration for Recovery Services Vault."), - // Operation: to.Ptr("Write Resource Storage Config"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Vault Storage Config"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupconfig/vaultconfig/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Returns Configuration for Recovery Services Vault."), - // Operation: to.Ptr("Get Resource Config"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Vault Config"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupconfig/vaultconfig/write"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Updates Configuration for Recovery Services Vault."), - // Operation: to.Ptr("Update Resource Config"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Vault Config"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/tokenInfo/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Returns token information for Recovery Services Vault."), - // Operation: to.Ptr("Get Vault Token Info"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Token Info"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupSecurityPIN/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Returns Security PIN Information for Recovery Services Vault."), - // Operation: to.Ptr("Get Security PIN Info"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("SecurityPINInfo"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupManagementMetaData/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Returns Backup Management Metadata for Recovery Services Vault."), - // Operation: to.Ptr("Get Backup Management Metadata"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Backup Management Metadata"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupOperationResults/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Returns Backup Operation Result for Recovery Services Vault."), - // Operation: to.Ptr("Get Backup Operation Result"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Backup Operation Results"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupOperations/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Returns Backup Operation Status for Recovery Services Vault."), - // Operation: to.Ptr("Get Backup Operation Status"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Backup Operation Status"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupJobs/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Returns all Job Objects"), - // Operation: to.Ptr("Get Jobs"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Backup Jobs"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupJobs/cancel/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Cancel the Job"), - // Operation: to.Ptr("Cancel Jobs"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Backup Jobs"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupJobsExport/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Export Jobs"), - // Operation: to.Ptr("Export Jobs"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Export Backup Jobs"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupJobs/operationResults/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Returns the Result of Job Operation."), - // Operation: to.Ptr("Get Job Operation Result"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Backup Jobs Operation Results"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupJobsExport/operationResults/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Returns the Result of Export Job Operation."), - // Operation: to.Ptr("Get Export Job Operation Result"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Export Backup Jobs Operation Results"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Get Recovery Points for Protected Items."), - // Operation: to.Ptr("Get Recovery Points"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Recovery Points"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/restore/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Restore Recovery Points for Protected Items."), - // Operation: to.Ptr("Restore Recovery Points"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Recovery Points"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/provisionInstantItemRecovery/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Provision Instant Item Recovery for Protected Item"), - // Operation: to.Ptr("Provision Instant Item Recovery for Protected Item"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Recovery Points"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/revokeInstantItemRecovery/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Revoke Instant Item Recovery for Protected Item"), - // Operation: to.Ptr("Revoke Instant Item Recovery for Protected Item"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Recovery Points"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupPolicies/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Returns all Protection Policies"), - // Operation: to.Ptr("Get Protection Policy"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Backup Policies"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupPolicies/write"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Creates Protection Policy"), - // Operation: to.Ptr("Create Protection Policy"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Backup Policies"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupPolicies/delete"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Delete a Protection Policy"), - // Operation: to.Ptr("Delete Protection Policy"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Backup Policies"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupPolicies/operationResults/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Get Results of Policy Operation."), - // Operation: to.Ptr("Get Policy Operation Results"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Backup Policy Operation Results"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupPolicies/operationStatus/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Get Status of Policy Operation."), - // Operation: to.Ptr("Get Policy Operation Status"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Backup Policy Operation Status"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Returns object details of the Protected Item"), - // Operation: to.Ptr("Get Protected Item Details"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupProtectedItems/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Returns the list of all Protected Items."), - // Operation: to.Ptr("Get All Protected Items"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/write"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Create a backup Protected Item"), - // Operation: to.Ptr("Create Backup Protected Item"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/delete"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Deletes Protected Item"), - // Operation: to.Ptr("Delete Protected Items"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/operationResults/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Gets Result of Operation Performed on Protected Items."), - // Operation: to.Ptr("Get Protected Items Operation Results"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Protected Item Operation Results"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/operationStatus/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Returns the status of Operation performed on Protected Items."), - // Operation: to.Ptr("Get Protected Items operation status"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Protected Item Operation Status"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/backup/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Performs Backup for Protected Item."), - // Operation: to.Ptr("Backup Protected Item"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupProtectableItems/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Returns list of all Protectable Items."), - // Operation: to.Ptr("Get Protectable Items"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Backup Protectable Items"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/refreshContainers/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Refreshes the container list"), - // Operation: to.Ptr("Refresh container"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Refresh Containers"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupFabrics/operationResults/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Returns status of the operation"), - // Operation: to.Ptr("Get Operation Results"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Refresh Containers Operation Results"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupProtectionContainers/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Returns all containers belonging to the subscription"), - // Operation: to.Ptr("Get Containers In Subscription"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Backup Protection Containers"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Returns all registered containers"), - // Operation: to.Ptr("Get Registered Container"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Protection Containers"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/operationResults/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Gets result of Operation performed on Protection Container."), - // Operation: to.Ptr("Get Container Operation Results"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Protection Containers Operation Results"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupEngines"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Returns all the backup management servers registered with vault."), - // Operation: to.Ptr("List of backup management servers."), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Backup Engines"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/backupStatus"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Check Backup Status for Recovery Services Vaults"), - // Operation: to.Ptr("Check Backup Status for Vault"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Backup Status"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/write"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("Create Vault operation creates an Azure resource of type 'vault'"), - // Operation: to.Ptr("Create Vault"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Vaults"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("The Get Vault operation gets an object representing the Azure resource of type 'vault'"), - // Operation: to.Ptr("Get Vault"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Vaults"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/delete"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("The Delete Vault operation deletes the specified Azure resource of type 'vault'"), - // Operation: to.Ptr("Delete Vault"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Vaults"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/extendedInformation/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("The Get Extended Info operation gets an object's Extended Info representing the Azure resource of type ?vault?"), - // Operation: to.Ptr("Get Extended Info"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Vaults"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/extendedInformation/write"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("The Get Extended Info operation gets an object's Extended Info representing the Azure resource of type ?vault?"), - // Operation: to.Ptr("Get Extended Info"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Vaults"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/Vaults/extendedInformation/delete"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("The Get Extended Info operation gets an object's Extended Info representing the Azure resource of type ?vault?"), - // Operation: to.Ptr("Get Extended Info"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("Vaults"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/locations/allocatedStamp/read"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("GetAllocatedStamp is internal operation used by service"), - // Operation: to.Ptr("Get Allocated Stamp"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("locations/allocatedStamp"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.RecoveryServices/locations/allocateStamp/action"), - // Display: &armrecoveryservicessiterecovery.Display{ - // Description: to.Ptr("AllocateStamp is internal operation used by service"), - // Operation: to.Ptr("Allocated Stamp Action"), - // Provider: to.Ptr("Microsoft.RecoveryServices"), - // Resource: to.Ptr("locations/allocateStamp"), - // }, - // Origin: to.Ptr("user"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/options.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/options.go new file mode 100644 index 000000000000..c371b41c256d --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/options.go @@ -0,0 +1,919 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armrecoveryservicessiterecovery + +// MigrationRecoveryPointsClientGetOptions contains the optional parameters for the MigrationRecoveryPointsClient.Get method. +type MigrationRecoveryPointsClientGetOptions struct { + // placeholder for future optional parameters +} + +// MigrationRecoveryPointsClientListByReplicationMigrationItemsOptions contains the optional parameters for the MigrationRecoveryPointsClient.NewListByReplicationMigrationItemsPager +// method. +type MigrationRecoveryPointsClientListByReplicationMigrationItemsOptions struct { + // placeholder for future optional parameters +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// RecoveryPointsClientGetOptions contains the optional parameters for the RecoveryPointsClient.Get method. +type RecoveryPointsClientGetOptions struct { + // placeholder for future optional parameters +} + +// RecoveryPointsClientListByReplicationProtectedItemsOptions contains the optional parameters for the RecoveryPointsClient.NewListByReplicationProtectedItemsPager +// method. +type RecoveryPointsClientListByReplicationProtectedItemsOptions struct { + // placeholder for future optional parameters +} + +// ReplicationAlertSettingsClientCreateOptions contains the optional parameters for the ReplicationAlertSettingsClient.Create +// method. +type ReplicationAlertSettingsClientCreateOptions struct { + // placeholder for future optional parameters +} + +// ReplicationAlertSettingsClientGetOptions contains the optional parameters for the ReplicationAlertSettingsClient.Get method. +type ReplicationAlertSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicationAlertSettingsClientListOptions contains the optional parameters for the ReplicationAlertSettingsClient.NewListPager +// method. +type ReplicationAlertSettingsClientListOptions struct { + // placeholder for future optional parameters +} + +// ReplicationAppliancesClientListOptions contains the optional parameters for the ReplicationAppliancesClient.NewListPager +// method. +type ReplicationAppliancesClientListOptions struct { + // OData filter options. + Filter *string +} + +// ReplicationEligibilityResultsClientGetOptions contains the optional parameters for the ReplicationEligibilityResultsClient.Get +// method. +type ReplicationEligibilityResultsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicationEligibilityResultsClientListOptions contains the optional parameters for the ReplicationEligibilityResultsClient.List +// method. +type ReplicationEligibilityResultsClientListOptions struct { + // placeholder for future optional parameters +} + +// ReplicationEventsClientGetOptions contains the optional parameters for the ReplicationEventsClient.Get method. +type ReplicationEventsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicationEventsClientListOptions contains the optional parameters for the ReplicationEventsClient.NewListPager method. +type ReplicationEventsClientListOptions struct { + // OData filter options. + Filter *string +} + +// ReplicationFabricsClientBeginCheckConsistencyOptions contains the optional parameters for the ReplicationFabricsClient.BeginCheckConsistency +// method. +type ReplicationFabricsClientBeginCheckConsistencyOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationFabricsClientBeginCreateOptions contains the optional parameters for the ReplicationFabricsClient.BeginCreate +// method. +type ReplicationFabricsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationFabricsClientBeginDeleteOptions contains the optional parameters for the ReplicationFabricsClient.BeginDelete +// method. +type ReplicationFabricsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationFabricsClientBeginMigrateToAADOptions contains the optional parameters for the ReplicationFabricsClient.BeginMigrateToAAD +// method. +type ReplicationFabricsClientBeginMigrateToAADOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationFabricsClientBeginPurgeOptions contains the optional parameters for the ReplicationFabricsClient.BeginPurge +// method. +type ReplicationFabricsClientBeginPurgeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationFabricsClientBeginReassociateGatewayOptions contains the optional parameters for the ReplicationFabricsClient.BeginReassociateGateway +// method. +type ReplicationFabricsClientBeginReassociateGatewayOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationFabricsClientBeginRenewCertificateOptions contains the optional parameters for the ReplicationFabricsClient.BeginRenewCertificate +// method. +type ReplicationFabricsClientBeginRenewCertificateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationFabricsClientGetOptions contains the optional parameters for the ReplicationFabricsClient.Get method. +type ReplicationFabricsClientGetOptions struct { + // OData filter options. + Filter *string +} + +// ReplicationFabricsClientListOptions contains the optional parameters for the ReplicationFabricsClient.NewListPager method. +type ReplicationFabricsClientListOptions struct { + // placeholder for future optional parameters +} + +// ReplicationJobsClientBeginCancelOptions contains the optional parameters for the ReplicationJobsClient.BeginCancel method. +type ReplicationJobsClientBeginCancelOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationJobsClientBeginExportOptions contains the optional parameters for the ReplicationJobsClient.BeginExport method. +type ReplicationJobsClientBeginExportOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationJobsClientBeginRestartOptions contains the optional parameters for the ReplicationJobsClient.BeginRestart method. +type ReplicationJobsClientBeginRestartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationJobsClientBeginResumeOptions contains the optional parameters for the ReplicationJobsClient.BeginResume method. +type ReplicationJobsClientBeginResumeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationJobsClientGetOptions contains the optional parameters for the ReplicationJobsClient.Get method. +type ReplicationJobsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicationJobsClientListOptions contains the optional parameters for the ReplicationJobsClient.NewListPager method. +type ReplicationJobsClientListOptions struct { + // OData filter options. + Filter *string +} + +// ReplicationLogicalNetworksClientGetOptions contains the optional parameters for the ReplicationLogicalNetworksClient.Get +// method. +type ReplicationLogicalNetworksClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicationLogicalNetworksClientListByReplicationFabricsOptions contains the optional parameters for the ReplicationLogicalNetworksClient.NewListByReplicationFabricsPager +// method. +type ReplicationLogicalNetworksClientListByReplicationFabricsOptions struct { + // placeholder for future optional parameters +} + +// ReplicationMigrationItemsClientBeginCreateOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginCreate +// method. +type ReplicationMigrationItemsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationMigrationItemsClientBeginDeleteOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginDelete +// method. +type ReplicationMigrationItemsClientBeginDeleteOptions struct { + // The delete option. + DeleteOption *string + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationMigrationItemsClientBeginMigrateOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginMigrate +// method. +type ReplicationMigrationItemsClientBeginMigrateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationMigrationItemsClientBeginPauseReplicationOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginPauseReplication +// method. +type ReplicationMigrationItemsClientBeginPauseReplicationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationMigrationItemsClientBeginResumeReplicationOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginResumeReplication +// method. +type ReplicationMigrationItemsClientBeginResumeReplicationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationMigrationItemsClientBeginResyncOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginResync +// method. +type ReplicationMigrationItemsClientBeginResyncOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationMigrationItemsClientBeginTestMigrateCleanupOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginTestMigrateCleanup +// method. +type ReplicationMigrationItemsClientBeginTestMigrateCleanupOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationMigrationItemsClientBeginTestMigrateOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginTestMigrate +// method. +type ReplicationMigrationItemsClientBeginTestMigrateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationMigrationItemsClientBeginUpdateOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginUpdate +// method. +type ReplicationMigrationItemsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationMigrationItemsClientGetOptions contains the optional parameters for the ReplicationMigrationItemsClient.Get +// method. +type ReplicationMigrationItemsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicationMigrationItemsClientListByReplicationProtectionContainersOptions contains the optional parameters for the ReplicationMigrationItemsClient.NewListByReplicationProtectionContainersPager +// method. +type ReplicationMigrationItemsClientListByReplicationProtectionContainersOptions struct { + // OData filter options. + Filter *string + + // The pagination token. + SkipToken *string + + // The page size. + TakeToken *string +} + +// ReplicationMigrationItemsClientListOptions contains the optional parameters for the ReplicationMigrationItemsClient.NewListPager +// method. +type ReplicationMigrationItemsClientListOptions struct { + // OData filter options. + Filter *string + + // The pagination token. + SkipToken *string + + // The page size. + TakeToken *string +} + +// ReplicationNetworkMappingsClientBeginCreateOptions contains the optional parameters for the ReplicationNetworkMappingsClient.BeginCreate +// method. +type ReplicationNetworkMappingsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationNetworkMappingsClientBeginDeleteOptions contains the optional parameters for the ReplicationNetworkMappingsClient.BeginDelete +// method. +type ReplicationNetworkMappingsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationNetworkMappingsClientBeginUpdateOptions contains the optional parameters for the ReplicationNetworkMappingsClient.BeginUpdate +// method. +type ReplicationNetworkMappingsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationNetworkMappingsClientGetOptions contains the optional parameters for the ReplicationNetworkMappingsClient.Get +// method. +type ReplicationNetworkMappingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicationNetworkMappingsClientListByReplicationNetworksOptions contains the optional parameters for the ReplicationNetworkMappingsClient.NewListByReplicationNetworksPager +// method. +type ReplicationNetworkMappingsClientListByReplicationNetworksOptions struct { + // placeholder for future optional parameters +} + +// ReplicationNetworkMappingsClientListOptions contains the optional parameters for the ReplicationNetworkMappingsClient.NewListPager +// method. +type ReplicationNetworkMappingsClientListOptions struct { + // placeholder for future optional parameters +} + +// ReplicationNetworksClientGetOptions contains the optional parameters for the ReplicationNetworksClient.Get method. +type ReplicationNetworksClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicationNetworksClientListByReplicationFabricsOptions contains the optional parameters for the ReplicationNetworksClient.NewListByReplicationFabricsPager +// method. +type ReplicationNetworksClientListByReplicationFabricsOptions struct { + // placeholder for future optional parameters +} + +// ReplicationNetworksClientListOptions contains the optional parameters for the ReplicationNetworksClient.NewListPager method. +type ReplicationNetworksClientListOptions struct { + // placeholder for future optional parameters +} + +// ReplicationPoliciesClientBeginCreateOptions contains the optional parameters for the ReplicationPoliciesClient.BeginCreate +// method. +type ReplicationPoliciesClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationPoliciesClientBeginDeleteOptions contains the optional parameters for the ReplicationPoliciesClient.BeginDelete +// method. +type ReplicationPoliciesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationPoliciesClientBeginUpdateOptions contains the optional parameters for the ReplicationPoliciesClient.BeginUpdate +// method. +type ReplicationPoliciesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationPoliciesClientGetOptions contains the optional parameters for the ReplicationPoliciesClient.Get method. +type ReplicationPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicationPoliciesClientListOptions contains the optional parameters for the ReplicationPoliciesClient.NewListPager method. +type ReplicationPoliciesClientListOptions struct { + // placeholder for future optional parameters +} + +// ReplicationProtectableItemsClientGetOptions contains the optional parameters for the ReplicationProtectableItemsClient.Get +// method. +type ReplicationProtectableItemsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicationProtectableItemsClientListByReplicationProtectionContainersOptions contains the optional parameters for the +// ReplicationProtectableItemsClient.NewListByReplicationProtectionContainersPager method. +type ReplicationProtectableItemsClientListByReplicationProtectionContainersOptions struct { + // OData filter options. + Filter *string + + // skipToken OData query parameter. + SkipToken *string + + // take OData query parameter. + Take *string +} + +// ReplicationProtectedItemsClientBeginAddDisksOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginAddDisks +// method. +type ReplicationProtectedItemsClientBeginAddDisksOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectedItemsClientBeginApplyRecoveryPointOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginApplyRecoveryPoint +// method. +type ReplicationProtectedItemsClientBeginApplyRecoveryPointOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectedItemsClientBeginCreateOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginCreate +// method. +type ReplicationProtectedItemsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectedItemsClientBeginDeleteOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginDelete +// method. +type ReplicationProtectedItemsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectedItemsClientBeginFailoverCancelOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginFailoverCancel +// method. +type ReplicationProtectedItemsClientBeginFailoverCancelOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectedItemsClientBeginFailoverCommitOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginFailoverCommit +// method. +type ReplicationProtectedItemsClientBeginFailoverCommitOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectedItemsClientBeginPlannedFailoverOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginPlannedFailover +// method. +type ReplicationProtectedItemsClientBeginPlannedFailoverOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectedItemsClientBeginPurgeOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginPurge +// method. +type ReplicationProtectedItemsClientBeginPurgeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectedItemsClientBeginRemoveDisksOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginRemoveDisks +// method. +type ReplicationProtectedItemsClientBeginRemoveDisksOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectedItemsClientBeginRepairReplicationOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginRepairReplication +// method. +type ReplicationProtectedItemsClientBeginRepairReplicationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectedItemsClientBeginReprotectOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginReprotect +// method. +type ReplicationProtectedItemsClientBeginReprotectOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectedItemsClientBeginResolveHealthErrorsOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginResolveHealthErrors +// method. +type ReplicationProtectedItemsClientBeginResolveHealthErrorsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectedItemsClientBeginSwitchProviderOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginSwitchProvider +// method. +type ReplicationProtectedItemsClientBeginSwitchProviderOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectedItemsClientBeginTestFailoverCleanupOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginTestFailoverCleanup +// method. +type ReplicationProtectedItemsClientBeginTestFailoverCleanupOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectedItemsClientBeginTestFailoverOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginTestFailover +// method. +type ReplicationProtectedItemsClientBeginTestFailoverOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectedItemsClientBeginUnplannedFailoverOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginUnplannedFailover +// method. +type ReplicationProtectedItemsClientBeginUnplannedFailoverOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectedItemsClientBeginUpdateApplianceOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginUpdateAppliance +// method. +type ReplicationProtectedItemsClientBeginUpdateApplianceOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectedItemsClientBeginUpdateMobilityServiceOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginUpdateMobilityService +// method. +type ReplicationProtectedItemsClientBeginUpdateMobilityServiceOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectedItemsClientBeginUpdateOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginUpdate +// method. +type ReplicationProtectedItemsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectedItemsClientGetOptions contains the optional parameters for the ReplicationProtectedItemsClient.Get +// method. +type ReplicationProtectedItemsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicationProtectedItemsClientListByReplicationProtectionContainersOptions contains the optional parameters for the ReplicationProtectedItemsClient.NewListByReplicationProtectionContainersPager +// method. +type ReplicationProtectedItemsClientListByReplicationProtectionContainersOptions struct { + // placeholder for future optional parameters +} + +// ReplicationProtectedItemsClientListOptions contains the optional parameters for the ReplicationProtectedItemsClient.NewListPager +// method. +type ReplicationProtectedItemsClientListOptions struct { + // OData filter options. + Filter *string + + // The pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. + SkipToken *string +} + +// ReplicationProtectionContainerMappingsClientBeginCreateOptions contains the optional parameters for the ReplicationProtectionContainerMappingsClient.BeginCreate +// method. +type ReplicationProtectionContainerMappingsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectionContainerMappingsClientBeginDeleteOptions contains the optional parameters for the ReplicationProtectionContainerMappingsClient.BeginDelete +// method. +type ReplicationProtectionContainerMappingsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectionContainerMappingsClientBeginPurgeOptions contains the optional parameters for the ReplicationProtectionContainerMappingsClient.BeginPurge +// method. +type ReplicationProtectionContainerMappingsClientBeginPurgeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectionContainerMappingsClientBeginUpdateOptions contains the optional parameters for the ReplicationProtectionContainerMappingsClient.BeginUpdate +// method. +type ReplicationProtectionContainerMappingsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectionContainerMappingsClientGetOptions contains the optional parameters for the ReplicationProtectionContainerMappingsClient.Get +// method. +type ReplicationProtectionContainerMappingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicationProtectionContainerMappingsClientListByReplicationProtectionContainersOptions contains the optional parameters +// for the ReplicationProtectionContainerMappingsClient.NewListByReplicationProtectionContainersPager method. +type ReplicationProtectionContainerMappingsClientListByReplicationProtectionContainersOptions struct { + // placeholder for future optional parameters +} + +// ReplicationProtectionContainerMappingsClientListOptions contains the optional parameters for the ReplicationProtectionContainerMappingsClient.NewListPager +// method. +type ReplicationProtectionContainerMappingsClientListOptions struct { + // placeholder for future optional parameters +} + +// ReplicationProtectionContainersClientBeginCreateOptions contains the optional parameters for the ReplicationProtectionContainersClient.BeginCreate +// method. +type ReplicationProtectionContainersClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectionContainersClientBeginDeleteOptions contains the optional parameters for the ReplicationProtectionContainersClient.BeginDelete +// method. +type ReplicationProtectionContainersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectionContainersClientBeginDiscoverProtectableItemOptions contains the optional parameters for the ReplicationProtectionContainersClient.BeginDiscoverProtectableItem +// method. +type ReplicationProtectionContainersClientBeginDiscoverProtectableItemOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectionContainersClientBeginSwitchProtectionOptions contains the optional parameters for the ReplicationProtectionContainersClient.BeginSwitchProtection +// method. +type ReplicationProtectionContainersClientBeginSwitchProtectionOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectionContainersClientGetOptions contains the optional parameters for the ReplicationProtectionContainersClient.Get +// method. +type ReplicationProtectionContainersClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicationProtectionContainersClientListByReplicationFabricsOptions contains the optional parameters for the ReplicationProtectionContainersClient.NewListByReplicationFabricsPager +// method. +type ReplicationProtectionContainersClientListByReplicationFabricsOptions struct { + // placeholder for future optional parameters +} + +// ReplicationProtectionContainersClientListOptions contains the optional parameters for the ReplicationProtectionContainersClient.NewListPager +// method. +type ReplicationProtectionContainersClientListOptions struct { + // placeholder for future optional parameters +} + +// ReplicationProtectionIntentsClientCreateOptions contains the optional parameters for the ReplicationProtectionIntentsClient.Create +// method. +type ReplicationProtectionIntentsClientCreateOptions struct { + // placeholder for future optional parameters +} + +// ReplicationProtectionIntentsClientGetOptions contains the optional parameters for the ReplicationProtectionIntentsClient.Get +// method. +type ReplicationProtectionIntentsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicationProtectionIntentsClientListOptions contains the optional parameters for the ReplicationProtectionIntentsClient.NewListPager +// method. +type ReplicationProtectionIntentsClientListOptions struct { + // The pagination token. + SkipToken *string + + // The page size. + TakeToken *string +} + +// ReplicationRecoveryPlansClientBeginCreateOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginCreate +// method. +type ReplicationRecoveryPlansClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationRecoveryPlansClientBeginDeleteOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginDelete +// method. +type ReplicationRecoveryPlansClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationRecoveryPlansClientBeginFailoverCancelOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginFailoverCancel +// method. +type ReplicationRecoveryPlansClientBeginFailoverCancelOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationRecoveryPlansClientBeginFailoverCommitOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginFailoverCommit +// method. +type ReplicationRecoveryPlansClientBeginFailoverCommitOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationRecoveryPlansClientBeginPlannedFailoverOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginPlannedFailover +// method. +type ReplicationRecoveryPlansClientBeginPlannedFailoverOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationRecoveryPlansClientBeginReprotectOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginReprotect +// method. +type ReplicationRecoveryPlansClientBeginReprotectOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationRecoveryPlansClientBeginTestFailoverCleanupOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginTestFailoverCleanup +// method. +type ReplicationRecoveryPlansClientBeginTestFailoverCleanupOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationRecoveryPlansClientBeginTestFailoverOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginTestFailover +// method. +type ReplicationRecoveryPlansClientBeginTestFailoverOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationRecoveryPlansClientBeginUnplannedFailoverOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginUnplannedFailover +// method. +type ReplicationRecoveryPlansClientBeginUnplannedFailoverOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationRecoveryPlansClientBeginUpdateOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginUpdate +// method. +type ReplicationRecoveryPlansClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationRecoveryPlansClientGetOptions contains the optional parameters for the ReplicationRecoveryPlansClient.Get method. +type ReplicationRecoveryPlansClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicationRecoveryPlansClientListOptions contains the optional parameters for the ReplicationRecoveryPlansClient.NewListPager +// method. +type ReplicationRecoveryPlansClientListOptions struct { + // placeholder for future optional parameters +} + +// ReplicationRecoveryServicesProvidersClientBeginCreateOptions contains the optional parameters for the ReplicationRecoveryServicesProvidersClient.BeginCreate +// method. +type ReplicationRecoveryServicesProvidersClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationRecoveryServicesProvidersClientBeginDeleteOptions contains the optional parameters for the ReplicationRecoveryServicesProvidersClient.BeginDelete +// method. +type ReplicationRecoveryServicesProvidersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationRecoveryServicesProvidersClientBeginPurgeOptions contains the optional parameters for the ReplicationRecoveryServicesProvidersClient.BeginPurge +// method. +type ReplicationRecoveryServicesProvidersClientBeginPurgeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationRecoveryServicesProvidersClientBeginRefreshProviderOptions contains the optional parameters for the ReplicationRecoveryServicesProvidersClient.BeginRefreshProvider +// method. +type ReplicationRecoveryServicesProvidersClientBeginRefreshProviderOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationRecoveryServicesProvidersClientGetOptions contains the optional parameters for the ReplicationRecoveryServicesProvidersClient.Get +// method. +type ReplicationRecoveryServicesProvidersClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicationRecoveryServicesProvidersClientListByReplicationFabricsOptions contains the optional parameters for the ReplicationRecoveryServicesProvidersClient.NewListByReplicationFabricsPager +// method. +type ReplicationRecoveryServicesProvidersClientListByReplicationFabricsOptions struct { + // placeholder for future optional parameters +} + +// ReplicationRecoveryServicesProvidersClientListOptions contains the optional parameters for the ReplicationRecoveryServicesProvidersClient.NewListPager +// method. +type ReplicationRecoveryServicesProvidersClientListOptions struct { + // placeholder for future optional parameters +} + +// ReplicationStorageClassificationMappingsClientBeginCreateOptions contains the optional parameters for the ReplicationStorageClassificationMappingsClient.BeginCreate +// method. +type ReplicationStorageClassificationMappingsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationStorageClassificationMappingsClientBeginDeleteOptions contains the optional parameters for the ReplicationStorageClassificationMappingsClient.BeginDelete +// method. +type ReplicationStorageClassificationMappingsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationStorageClassificationMappingsClientGetOptions contains the optional parameters for the ReplicationStorageClassificationMappingsClient.Get +// method. +type ReplicationStorageClassificationMappingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicationStorageClassificationMappingsClientListByReplicationStorageClassificationsOptions contains the optional parameters +// for the ReplicationStorageClassificationMappingsClient.NewListByReplicationStorageClassificationsPager method. +type ReplicationStorageClassificationMappingsClientListByReplicationStorageClassificationsOptions struct { + // placeholder for future optional parameters +} + +// ReplicationStorageClassificationMappingsClientListOptions contains the optional parameters for the ReplicationStorageClassificationMappingsClient.NewListPager +// method. +type ReplicationStorageClassificationMappingsClientListOptions struct { + // placeholder for future optional parameters +} + +// ReplicationStorageClassificationsClientGetOptions contains the optional parameters for the ReplicationStorageClassificationsClient.Get +// method. +type ReplicationStorageClassificationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicationStorageClassificationsClientListByReplicationFabricsOptions contains the optional parameters for the ReplicationStorageClassificationsClient.NewListByReplicationFabricsPager +// method. +type ReplicationStorageClassificationsClientListByReplicationFabricsOptions struct { + // placeholder for future optional parameters +} + +// ReplicationStorageClassificationsClientListOptions contains the optional parameters for the ReplicationStorageClassificationsClient.NewListPager +// method. +type ReplicationStorageClassificationsClientListOptions struct { + // placeholder for future optional parameters +} + +// ReplicationVaultHealthClientBeginRefreshOptions contains the optional parameters for the ReplicationVaultHealthClient.BeginRefresh +// method. +type ReplicationVaultHealthClientBeginRefreshOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationVaultHealthClientGetOptions contains the optional parameters for the ReplicationVaultHealthClient.Get method. +type ReplicationVaultHealthClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicationVaultSettingClientBeginCreateOptions contains the optional parameters for the ReplicationVaultSettingClient.BeginCreate +// method. +type ReplicationVaultSettingClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationVaultSettingClientGetOptions contains the optional parameters for the ReplicationVaultSettingClient.Get method. +type ReplicationVaultSettingClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicationVaultSettingClientListOptions contains the optional parameters for the ReplicationVaultSettingClient.NewListPager +// method. +type ReplicationVaultSettingClientListOptions struct { + // placeholder for future optional parameters +} + +// ReplicationvCentersClientBeginCreateOptions contains the optional parameters for the ReplicationvCentersClient.BeginCreate +// method. +type ReplicationvCentersClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationvCentersClientBeginDeleteOptions contains the optional parameters for the ReplicationvCentersClient.BeginDelete +// method. +type ReplicationvCentersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationvCentersClientBeginUpdateOptions contains the optional parameters for the ReplicationvCentersClient.BeginUpdate +// method. +type ReplicationvCentersClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationvCentersClientGetOptions contains the optional parameters for the ReplicationvCentersClient.Get method. +type ReplicationvCentersClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicationvCentersClientListByReplicationFabricsOptions contains the optional parameters for the ReplicationvCentersClient.NewListByReplicationFabricsPager +// method. +type ReplicationvCentersClientListByReplicationFabricsOptions struct { + // placeholder for future optional parameters +} + +// ReplicationvCentersClientListOptions contains the optional parameters for the ReplicationvCentersClient.NewListPager method. +type ReplicationvCentersClientListOptions struct { + // placeholder for future optional parameters +} + +// SupportedOperatingSystemsClientGetOptions contains the optional parameters for the SupportedOperatingSystemsClient.Get +// method. +type SupportedOperatingSystemsClientGetOptions struct { + // The instance type. + InstanceType *string +} + +// TargetComputeSizesClientListByReplicationProtectedItemsOptions contains the optional parameters for the TargetComputeSizesClient.NewListByReplicationProtectedItemsPager +// method. +type TargetComputeSizesClientListByReplicationProtectedItemsOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/polymorphic_helpers.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/polymorphic_helpers.go index 80fbf63cc2b7..8b508e70feba 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/polymorphic_helpers.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/polymorphic_helpers.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -26,7 +25,10 @@ func unmarshalAddDisksProviderSpecificInputClassification(rawMsg json.RawMessage default: b = &AddDisksProviderSpecificInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalApplianceSpecificDetailsClassification(rawMsg json.RawMessage) (ApplianceSpecificDetailsClassification, error) { @@ -44,7 +46,10 @@ func unmarshalApplianceSpecificDetailsClassification(rawMsg json.RawMessage) (Ap default: b = &ApplianceSpecificDetails{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalApplyRecoveryPointProviderSpecificInputClassification(rawMsg json.RawMessage) (ApplyRecoveryPointProviderSpecificInputClassification, error) { @@ -70,7 +75,10 @@ func unmarshalApplyRecoveryPointProviderSpecificInputClassification(rawMsg json. default: b = &ApplyRecoveryPointProviderSpecificInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalConfigurationSettingsClassification(rawMsg json.RawMessage) (ConfigurationSettingsClassification, error) { @@ -94,7 +102,10 @@ func unmarshalConfigurationSettingsClassification(rawMsg json.RawMessage) (Confi default: b = &ConfigurationSettings{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalCreateProtectionIntentProviderSpecificDetailsClassification(rawMsg json.RawMessage) (CreateProtectionIntentProviderSpecificDetailsClassification, error) { @@ -112,7 +123,10 @@ func unmarshalCreateProtectionIntentProviderSpecificDetailsClassification(rawMsg default: b = &CreateProtectionIntentProviderSpecificDetails{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalDisableProtectionProviderSpecificInputClassification(rawMsg json.RawMessage) (DisableProtectionProviderSpecificInputClassification, error) { @@ -130,7 +144,10 @@ func unmarshalDisableProtectionProviderSpecificInputClassification(rawMsg json.R default: b = &DisableProtectionProviderSpecificInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalEnableMigrationProviderSpecificInputClassification(rawMsg json.RawMessage) (EnableMigrationProviderSpecificInputClassification, error) { @@ -148,7 +165,10 @@ func unmarshalEnableMigrationProviderSpecificInputClassification(rawMsg json.Raw default: b = &EnableMigrationProviderSpecificInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalEnableProtectionProviderSpecificInputClassification(rawMsg json.RawMessage) (EnableProtectionProviderSpecificInputClassification, error) { @@ -176,7 +196,10 @@ func unmarshalEnableProtectionProviderSpecificInputClassification(rawMsg json.Ra default: b = &EnableProtectionProviderSpecificInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalEventProviderSpecificDetailsClassification(rawMsg json.RawMessage) (EventProviderSpecificDetailsClassification, error) { @@ -210,7 +233,10 @@ func unmarshalEventProviderSpecificDetailsClassification(rawMsg json.RawMessage) default: b = &EventProviderSpecificDetails{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalEventSpecificDetailsClassification(rawMsg json.RawMessage) (EventSpecificDetailsClassification, error) { @@ -228,7 +254,10 @@ func unmarshalEventSpecificDetailsClassification(rawMsg json.RawMessage) (EventS default: b = &EventSpecificDetails{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalFabricSpecificCreateNetworkMappingInputClassification(rawMsg json.RawMessage) (FabricSpecificCreateNetworkMappingInputClassification, error) { @@ -250,7 +279,10 @@ func unmarshalFabricSpecificCreateNetworkMappingInputClassification(rawMsg json. default: b = &FabricSpecificCreateNetworkMappingInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalFabricSpecificCreationInputClassification(rawMsg json.RawMessage) (FabricSpecificCreationInputClassification, error) { @@ -272,7 +304,10 @@ func unmarshalFabricSpecificCreationInputClassification(rawMsg json.RawMessage) default: b = &FabricSpecificCreationInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalFabricSpecificDetailsClassification(rawMsg json.RawMessage) (FabricSpecificDetailsClassification, error) { @@ -300,7 +335,10 @@ func unmarshalFabricSpecificDetailsClassification(rawMsg json.RawMessage) (Fabri default: b = &FabricSpecificDetails{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalFabricSpecificUpdateNetworkMappingInputClassification(rawMsg json.RawMessage) (FabricSpecificUpdateNetworkMappingInputClassification, error) { @@ -322,7 +360,10 @@ func unmarshalFabricSpecificUpdateNetworkMappingInputClassification(rawMsg json. default: b = &FabricSpecificUpdateNetworkMappingInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalGroupTaskDetailsClassification(rawMsg json.RawMessage) (GroupTaskDetailsClassification, error) { @@ -344,7 +385,10 @@ func unmarshalGroupTaskDetailsClassification(rawMsg json.RawMessage) (GroupTaskD default: b = &GroupTaskDetails{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalJobDetailsClassification(rawMsg json.RawMessage) (JobDetailsClassification, error) { @@ -370,7 +414,10 @@ func unmarshalJobDetailsClassification(rawMsg json.RawMessage) (JobDetailsClassi default: b = &JobDetails{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalMigrateProviderSpecificInputClassification(rawMsg json.RawMessage) (MigrateProviderSpecificInputClassification, error) { @@ -388,7 +435,10 @@ func unmarshalMigrateProviderSpecificInputClassification(rawMsg json.RawMessage) default: b = &MigrateProviderSpecificInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalMigrationProviderSpecificSettingsClassification(rawMsg json.RawMessage) (MigrationProviderSpecificSettingsClassification, error) { @@ -406,7 +456,10 @@ func unmarshalMigrationProviderSpecificSettingsClassification(rawMsg json.RawMes default: b = &MigrationProviderSpecificSettings{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalNetworkMappingFabricSpecificSettingsClassification(rawMsg json.RawMessage) (NetworkMappingFabricSpecificSettingsClassification, error) { @@ -428,7 +481,10 @@ func unmarshalNetworkMappingFabricSpecificSettingsClassification(rawMsg json.Raw default: b = &NetworkMappingFabricSpecificSettings{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalPlannedFailoverProviderSpecificFailoverInputClassification(rawMsg json.RawMessage) (PlannedFailoverProviderSpecificFailoverInputClassification, error) { @@ -450,7 +506,10 @@ func unmarshalPlannedFailoverProviderSpecificFailoverInputClassification(rawMsg default: b = &PlannedFailoverProviderSpecificFailoverInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalPolicyProviderSpecificDetailsClassification(rawMsg json.RawMessage) (PolicyProviderSpecificDetailsClassification, error) { @@ -488,7 +547,10 @@ func unmarshalPolicyProviderSpecificDetailsClassification(rawMsg json.RawMessage default: b = &PolicyProviderSpecificDetails{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalPolicyProviderSpecificInputClassification(rawMsg json.RawMessage) (PolicyProviderSpecificInputClassification, error) { @@ -524,7 +586,10 @@ func unmarshalPolicyProviderSpecificInputClassification(rawMsg json.RawMessage) default: b = &PolicyProviderSpecificInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalProtectionContainerMappingProviderSpecificDetailsClassification(rawMsg json.RawMessage) (ProtectionContainerMappingProviderSpecificDetailsClassification, error) { @@ -546,7 +611,10 @@ func unmarshalProtectionContainerMappingProviderSpecificDetailsClassification(ra default: b = &ProtectionContainerMappingProviderSpecificDetails{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalProtectionProfileCustomDetailsClassification(rawMsg json.RawMessage) (ProtectionProfileCustomDetailsClassification, error) { @@ -566,7 +634,10 @@ func unmarshalProtectionProfileCustomDetailsClassification(rawMsg json.RawMessag default: b = &ProtectionProfileCustomDetails{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalProviderSpecificRecoveryPointDetailsClassification(rawMsg json.RawMessage) (ProviderSpecificRecoveryPointDetailsClassification, error) { @@ -588,7 +659,10 @@ func unmarshalProviderSpecificRecoveryPointDetailsClassification(rawMsg json.Raw default: b = &ProviderSpecificRecoveryPointDetails{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalRecoveryAvailabilitySetCustomDetailsClassification(rawMsg json.RawMessage) (RecoveryAvailabilitySetCustomDetailsClassification, error) { @@ -606,7 +680,10 @@ func unmarshalRecoveryAvailabilitySetCustomDetailsClassification(rawMsg json.Raw default: b = &RecoveryAvailabilitySetCustomDetails{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalRecoveryPlanActionDetailsClassification(rawMsg json.RawMessage) (RecoveryPlanActionDetailsClassification, error) { @@ -628,7 +705,10 @@ func unmarshalRecoveryPlanActionDetailsClassification(rawMsg json.RawMessage) (R default: b = &RecoveryPlanActionDetails{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalRecoveryPlanProviderSpecificDetailsClassification(rawMsg json.RawMessage) (RecoveryPlanProviderSpecificDetailsClassification, error) { @@ -646,7 +726,10 @@ func unmarshalRecoveryPlanProviderSpecificDetailsClassification(rawMsg json.RawM default: b = &RecoveryPlanProviderSpecificDetails{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalRecoveryPlanProviderSpecificDetailsClassificationArray(rawMsg json.RawMessage) ([]RecoveryPlanProviderSpecificDetailsClassification, error) { @@ -695,7 +778,10 @@ func unmarshalRecoveryPlanProviderSpecificFailoverInputClassification(rawMsg jso default: b = &RecoveryPlanProviderSpecificFailoverInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalRecoveryPlanProviderSpecificFailoverInputClassificationArray(rawMsg json.RawMessage) ([]RecoveryPlanProviderSpecificFailoverInputClassification, error) { @@ -732,7 +818,10 @@ func unmarshalRecoveryPlanProviderSpecificInputClassification(rawMsg json.RawMes default: b = &RecoveryPlanProviderSpecificInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalRecoveryPlanProviderSpecificInputClassificationArray(rawMsg json.RawMessage) ([]RecoveryPlanProviderSpecificInputClassification, error) { @@ -769,7 +858,10 @@ func unmarshalRecoveryProximityPlacementGroupCustomDetailsClassification(rawMsg default: b = &RecoveryProximityPlacementGroupCustomDetails{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalRecoveryResourceGroupCustomDetailsClassification(rawMsg json.RawMessage) (RecoveryResourceGroupCustomDetailsClassification, error) { @@ -787,7 +879,10 @@ func unmarshalRecoveryResourceGroupCustomDetailsClassification(rawMsg json.RawMe default: b = &RecoveryResourceGroupCustomDetails{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalRecoveryVirtualNetworkCustomDetailsClassification(rawMsg json.RawMessage) (RecoveryVirtualNetworkCustomDetailsClassification, error) { @@ -807,7 +902,10 @@ func unmarshalRecoveryVirtualNetworkCustomDetailsClassification(rawMsg json.RawM default: b = &RecoveryVirtualNetworkCustomDetails{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalRemoveDisksProviderSpecificInputClassification(rawMsg json.RawMessage) (RemoveDisksProviderSpecificInputClassification, error) { @@ -825,7 +923,10 @@ func unmarshalRemoveDisksProviderSpecificInputClassification(rawMsg json.RawMess default: b = &RemoveDisksProviderSpecificInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalReplicationProtectionIntentProviderSpecificSettingsClassification(rawMsg json.RawMessage) (ReplicationProtectionIntentProviderSpecificSettingsClassification, error) { @@ -843,7 +944,10 @@ func unmarshalReplicationProtectionIntentProviderSpecificSettingsClassification( default: b = &ReplicationProtectionIntentProviderSpecificSettings{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalReplicationProviderSpecificContainerCreationInputClassification(rawMsg json.RawMessage) (ReplicationProviderSpecificContainerCreationInputClassification, error) { @@ -865,7 +969,10 @@ func unmarshalReplicationProviderSpecificContainerCreationInputClassification(ra default: b = &ReplicationProviderSpecificContainerCreationInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalReplicationProviderSpecificContainerCreationInputClassificationArray(rawMsg json.RawMessage) ([]ReplicationProviderSpecificContainerCreationInputClassification, error) { @@ -904,7 +1011,10 @@ func unmarshalReplicationProviderSpecificContainerMappingInputClassification(raw default: b = &ReplicationProviderSpecificContainerMappingInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalReplicationProviderSpecificSettingsClassification(rawMsg json.RawMessage) (ReplicationProviderSpecificSettingsClassification, error) { @@ -940,7 +1050,10 @@ func unmarshalReplicationProviderSpecificSettingsClassification(rawMsg json.RawM default: b = &ReplicationProviderSpecificSettings{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalReplicationProviderSpecificUpdateContainerMappingInputClassification(rawMsg json.RawMessage) (ReplicationProviderSpecificUpdateContainerMappingInputClassification, error) { @@ -960,7 +1073,10 @@ func unmarshalReplicationProviderSpecificUpdateContainerMappingInputClassificati default: b = &ReplicationProviderSpecificUpdateContainerMappingInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalResumeReplicationProviderSpecificInputClassification(rawMsg json.RawMessage) (ResumeReplicationProviderSpecificInputClassification, error) { @@ -978,7 +1094,10 @@ func unmarshalResumeReplicationProviderSpecificInputClassification(rawMsg json.R default: b = &ResumeReplicationProviderSpecificInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalResyncProviderSpecificInputClassification(rawMsg json.RawMessage) (ResyncProviderSpecificInputClassification, error) { @@ -996,7 +1115,10 @@ func unmarshalResyncProviderSpecificInputClassification(rawMsg json.RawMessage) default: b = &ResyncProviderSpecificInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalReverseReplicationProviderSpecificInputClassification(rawMsg json.RawMessage) (ReverseReplicationProviderSpecificInputClassification, error) { @@ -1024,7 +1146,10 @@ func unmarshalReverseReplicationProviderSpecificInputClassification(rawMsg json. default: b = &ReverseReplicationProviderSpecificInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalStorageAccountCustomDetailsClassification(rawMsg json.RawMessage) (StorageAccountCustomDetailsClassification, error) { @@ -1042,7 +1167,10 @@ func unmarshalStorageAccountCustomDetailsClassification(rawMsg json.RawMessage) default: b = &StorageAccountCustomDetails{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalSwitchProtectionProviderSpecificInputClassification(rawMsg json.RawMessage) (SwitchProtectionProviderSpecificInputClassification, error) { @@ -1060,7 +1188,10 @@ func unmarshalSwitchProtectionProviderSpecificInputClassification(rawMsg json.Ra default: b = &SwitchProtectionProviderSpecificInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalSwitchProviderSpecificInputClassification(rawMsg json.RawMessage) (SwitchProviderSpecificInputClassification, error) { @@ -1078,7 +1209,10 @@ func unmarshalSwitchProviderSpecificInputClassification(rawMsg json.RawMessage) default: b = &SwitchProviderSpecificInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalTaskTypeDetailsClassification(rawMsg json.RawMessage) (TaskTypeDetailsClassification, error) { @@ -1110,7 +1244,10 @@ func unmarshalTaskTypeDetailsClassification(rawMsg json.RawMessage) (TaskTypeDet default: b = &TaskTypeDetails{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalTestFailoverProviderSpecificInputClassification(rawMsg json.RawMessage) (TestFailoverProviderSpecificInputClassification, error) { @@ -1136,7 +1273,10 @@ func unmarshalTestFailoverProviderSpecificInputClassification(rawMsg json.RawMes default: b = &TestFailoverProviderSpecificInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalTestMigrateProviderSpecificInputClassification(rawMsg json.RawMessage) (TestMigrateProviderSpecificInputClassification, error) { @@ -1154,7 +1294,10 @@ func unmarshalTestMigrateProviderSpecificInputClassification(rawMsg json.RawMess default: b = &TestMigrateProviderSpecificInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalUnplannedFailoverProviderSpecificInputClassification(rawMsg json.RawMessage) (UnplannedFailoverProviderSpecificInputClassification, error) { @@ -1180,7 +1323,10 @@ func unmarshalUnplannedFailoverProviderSpecificInputClassification(rawMsg json.R default: b = &UnplannedFailoverProviderSpecificInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalUpdateApplianceForReplicationProtectedItemProviderSpecificInputClassification(rawMsg json.RawMessage) (UpdateApplianceForReplicationProtectedItemProviderSpecificInputClassification, error) { @@ -1198,7 +1344,10 @@ func unmarshalUpdateApplianceForReplicationProtectedItemProviderSpecificInputCla default: b = &UpdateApplianceForReplicationProtectedItemProviderSpecificInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalUpdateMigrationItemProviderSpecificInputClassification(rawMsg json.RawMessage) (UpdateMigrationItemProviderSpecificInputClassification, error) { @@ -1216,7 +1365,10 @@ func unmarshalUpdateMigrationItemProviderSpecificInputClassification(rawMsg json default: b = &UpdateMigrationItemProviderSpecificInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalUpdateReplicationProtectedItemProviderInputClassification(rawMsg json.RawMessage) (UpdateReplicationProtectedItemProviderInputClassification, error) { @@ -1240,5 +1392,8 @@ func unmarshalUpdateReplicationProtectedItemProviderInputClassification(rawMsg j default: b = &UpdateReplicationProtectedItemProviderInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/recoverypoints_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/recoverypoints_client.go index 7327eb0deb82..247eb469c49d 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/recoverypoints_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/recoverypoints_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -47,7 +46,7 @@ func NewRecoveryPointsClient(subscriptionID string, credential azcore.TokenCrede // Get - Get the details of specified recovery point. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - The fabric name. @@ -56,18 +55,21 @@ func NewRecoveryPointsClient(subscriptionID string, credential azcore.TokenCrede // - recoveryPointName - The recovery point name. // - options - RecoveryPointsClientGetOptions contains the optional parameters for the RecoveryPointsClient.Get method. func (client *RecoveryPointsClient) Get(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string, options *RecoveryPointsClientGetOptions) (RecoveryPointsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, recoveryPointName, options) if err != nil { return RecoveryPointsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RecoveryPointsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RecoveryPointsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RecoveryPointsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -106,7 +108,7 @@ func (client *RecoveryPointsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -123,7 +125,7 @@ func (client *RecoveryPointsClient) getHandleResponse(resp *http.Response) (Reco // NewListByReplicationProtectedItemsPager - Lists the available recovery points for a replication protected item. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - The fabric name. @@ -191,7 +193,7 @@ func (client *RecoveryPointsClient) listByReplicationProtectedItemsCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/recoverypoints_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/recoverypoints_client_example_test.go deleted file mode 100644 index aa0e5897518d..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/recoverypoints_client_example_test.go +++ /dev/null @@ -1,93 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/RecoveryPoints_ListByReplicationProtectedItems.json -func ExampleRecoveryPointsClient_NewListByReplicationProtectedItemsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRecoveryPointsClient().NewListByReplicationProtectedItemsPager("vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RecoveryPointCollection = armrecoveryservicessiterecovery.RecoveryPointCollection{ - // Value: []*armrecoveryservicessiterecovery.RecoveryPoint{ - // { - // Name: to.Ptr("b22134ea-620c-474b-9fa5-3c1cb47708e3"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/recoveryPoints"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b/recoveryPoints/b22134ea-620c-474b-9fa5-3c1cb47708e3"), - // Properties: &armrecoveryservicessiterecovery.RecoveryPointProperties{ - // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-26T06:37:50.8082715Z"); return t}()), - // RecoveryPointType: to.Ptr("CrashConsistent"), - // }, - // }, - // { - // Name: to.Ptr("34cb2d05-e730-4d3f-b96b-a60a5e92acb2"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/recoveryPoints"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b/recoveryPoints/34cb2d05-e730-4d3f-b96b-a60a5e92acb2"), - // Properties: &armrecoveryservicessiterecovery.RecoveryPointProperties{ - // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-26T07:37:30.9722019Z"); return t}()), - // RecoveryPointType: to.Ptr("CrashConsistent"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/RecoveryPoints_Get.json -func ExampleRecoveryPointsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRecoveryPointsClient().Get(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", "b22134ea-620c-474b-9fa5-3c1cb47708e3", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecoveryPoint = armrecoveryservicessiterecovery.RecoveryPoint{ - // Name: to.Ptr("b22134ea-620c-474b-9fa5-3c1cb47708e3"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/recoveryPoints"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b/recoveryPoints/b22134ea-620c-474b-9fa5-3c1cb47708e3"), - // Properties: &armrecoveryservicessiterecovery.RecoveryPointProperties{ - // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-26T06:37:50.8082715Z"); return t}()), - // RecoveryPointType: to.Ptr("CrashConsistent"), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationalertsettings_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationalertsettings_client.go index 3c9b7ccddd46..5c5fb9f61bd8 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationalertsettings_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationalertsettings_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -47,7 +46,7 @@ func NewReplicationAlertSettingsClient(subscriptionID string, credential azcore. // Create - Create or update an email notification(alert) configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - alertSettingName - The name of the email notification(alert) configuration. @@ -55,18 +54,21 @@ func NewReplicationAlertSettingsClient(subscriptionID string, credential azcore. // - options - ReplicationAlertSettingsClientCreateOptions contains the optional parameters for the ReplicationAlertSettingsClient.Create // method. func (client *ReplicationAlertSettingsClient) Create(ctx context.Context, resourceName string, resourceGroupName string, alertSettingName string, request ConfigureAlertRequest, options *ReplicationAlertSettingsClientCreateOptions) (ReplicationAlertSettingsClientCreateResponse, error) { + var err error req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, alertSettingName, request, options) if err != nil { return ReplicationAlertSettingsClientCreateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationAlertSettingsClientCreateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationAlertSettingsClientCreateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationAlertSettingsClientCreateResponse{}, err } - return client.createHandleResponse(resp) + resp, err := client.createHandleResponse(httpResp) + return resp, err } // createCreateRequest creates the Create request. @@ -93,10 +95,13 @@ func (client *ReplicationAlertSettingsClient) createCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, request) + if err := runtime.MarshalAsJSON(req, request); err != nil { + return nil, err + } + return req, nil } // createHandleResponse handles the Create response. @@ -111,25 +116,28 @@ func (client *ReplicationAlertSettingsClient) createHandleResponse(resp *http.Re // Get - Gets the details of the specified email notification(alert) configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - alertSettingName - The name of the email notification configuration. // - options - ReplicationAlertSettingsClientGetOptions contains the optional parameters for the ReplicationAlertSettingsClient.Get // method. func (client *ReplicationAlertSettingsClient) Get(ctx context.Context, resourceName string, resourceGroupName string, alertSettingName string, options *ReplicationAlertSettingsClientGetOptions) (ReplicationAlertSettingsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, alertSettingName, options) if err != nil { return ReplicationAlertSettingsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationAlertSettingsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationAlertSettingsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationAlertSettingsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -156,7 +164,7 @@ func (client *ReplicationAlertSettingsClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -173,7 +181,7 @@ func (client *ReplicationAlertSettingsClient) getHandleResponse(resp *http.Respo // NewListPager - Gets the list of email notification(alert) configurations for the vault. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ReplicationAlertSettingsClientListOptions contains the optional parameters for the ReplicationAlertSettingsClient.NewListPager @@ -226,7 +234,7 @@ func (client *ReplicationAlertSettingsClient) listCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationalertsettings_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationalertsettings_client_example_test.go deleted file mode 100644 index 11deaca3ef54..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationalertsettings_client_example_test.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_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/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAlertSettings_List.json -func ExampleReplicationAlertSettingsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationAlertSettingsClient().NewListPager("vault1", "resourceGroupPS1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AlertCollection = armrecoveryservicessiterecovery.AlertCollection{ - // Value: []*armrecoveryservicessiterecovery.Alert{ - // { - // Name: to.Ptr("defaultAlertSetting"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationAlertSettings"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationAlertSettings/defaultAlertSetting"), - // Properties: &armrecoveryservicessiterecovery.AlertProperties{ - // CustomEmailAddresses: []*string{ - // to.Ptr("ronehr@microsoft.com")}, - // Locale: to.Ptr("en-US"), - // SendToOwners: to.Ptr("false"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAlertSettings_Get.json -func ExampleReplicationAlertSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationAlertSettingsClient().Get(ctx, "vault1", "resourceGroupPS1", "defaultAlertSetting", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Alert = armrecoveryservicessiterecovery.Alert{ - // Name: to.Ptr("defaultAlertSetting"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationAlertSettings"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationAlertSettings/defaultAlertSetting"), - // Properties: &armrecoveryservicessiterecovery.AlertProperties{ - // CustomEmailAddresses: []*string{ - // to.Ptr("ronehr@microsoft.com")}, - // Locale: to.Ptr("en-US"), - // SendToOwners: to.Ptr("false"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAlertSettings_Create.json -func ExampleReplicationAlertSettingsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationAlertSettingsClient().Create(ctx, "vault1", "resourceGroupPS1", "defaultAlertSetting", armrecoveryservicessiterecovery.ConfigureAlertRequest{ - Properties: &armrecoveryservicessiterecovery.ConfigureAlertRequestProperties{ - CustomEmailAddresses: []*string{ - to.Ptr("ronehr@microsoft.com")}, - Locale: to.Ptr(""), - SendToOwners: to.Ptr("false"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Alert = armrecoveryservicessiterecovery.Alert{ - // Name: to.Ptr("defaultAlertSetting"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationAlertSettings"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationAlertSettings/defaultAlertSetting"), - // Properties: &armrecoveryservicessiterecovery.AlertProperties{ - // CustomEmailAddresses: []*string{ - // to.Ptr("ronehr@microsoft.com")}, - // Locale: to.Ptr("en-US"), - // SendToOwners: to.Ptr("false"), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationappliances_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationappliances_client.go index 0d50ab6f5408..030d36b4492f 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationappliances_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationappliances_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -46,7 +45,7 @@ func NewReplicationAppliancesClient(subscriptionID string, credential azcore.Tok // NewListPager - Gets the list of Azure Site Recovery appliances for the vault. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ReplicationAppliancesClientListOptions contains the optional parameters for the ReplicationAppliancesClient.NewListPager @@ -99,7 +98,7 @@ func (client *ReplicationAppliancesClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationappliances_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationappliances_client_example_test.go deleted file mode 100644 index bb96903f1569..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationappliances_client_example_test.go +++ /dev/null @@ -1,55 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAppliances_List.json -func ExampleReplicationAppliancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationAppliancesClient().NewListPager("vault1", "resourceGroupPS1", &armrecoveryservicessiterecovery.ReplicationAppliancesClientListOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ApplianceCollection = armrecoveryservicessiterecovery.ApplianceCollection{ - // Value: []*armrecoveryservicessiterecovery.ReplicationAppliance{ - // { - // Properties: &armrecoveryservicessiterecovery.ReplicationApplianceProperties{ - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.InMageRcmApplianceSpecificDetails{ - // InstanceType: to.Ptr("InMageRcm"), - // Appliances: []*armrecoveryservicessiterecovery.InMageRcmApplianceDetails{ - // }, - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationeligibilityresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationeligibilityresults_client.go index a312317e7717..f21723fc1493 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationeligibilityresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationeligibilityresults_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -47,24 +46,27 @@ func NewReplicationEligibilityResultsClient(subscriptionID string, credential az // Get - Validates whether a given VM can be protected or not in which case returns list of errors. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - virtualMachineName - Virtual Machine name. // - options - ReplicationEligibilityResultsClientGetOptions contains the optional parameters for the ReplicationEligibilityResultsClient.Get // method. func (client *ReplicationEligibilityResultsClient) Get(ctx context.Context, resourceGroupName string, virtualMachineName string, options *ReplicationEligibilityResultsClientGetOptions) (ReplicationEligibilityResultsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, virtualMachineName, options) if err != nil { return ReplicationEligibilityResultsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationEligibilityResultsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationEligibilityResultsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationEligibilityResultsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -87,7 +89,7 @@ func (client *ReplicationEligibilityResultsClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -105,24 +107,27 @@ func (client *ReplicationEligibilityResultsClient) getHandleResponse(resp *http. // List - Validates whether a given VM can be protected or not in which case returns list of errors. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - virtualMachineName - Virtual Machine name. // - options - ReplicationEligibilityResultsClientListOptions contains the optional parameters for the ReplicationEligibilityResultsClient.List // method. func (client *ReplicationEligibilityResultsClient) List(ctx context.Context, resourceGroupName string, virtualMachineName string, options *ReplicationEligibilityResultsClientListOptions) (ReplicationEligibilityResultsClientListResponse, error) { + var err error req, err := client.listCreateRequest(ctx, resourceGroupName, virtualMachineName, options) if err != nil { return ReplicationEligibilityResultsClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationEligibilityResultsClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationEligibilityResultsClientListResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationEligibilityResultsClientListResponse{}, err } - return client.listHandleResponse(resp) + resp, err := client.listHandleResponse(httpResp) + return resp, err } // listCreateRequest creates the List request. @@ -145,7 +150,7 @@ func (client *ReplicationEligibilityResultsClient) listCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationeligibilityresults_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationeligibilityresults_client_example_test.go deleted file mode 100644 index 16c4589244dc..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationeligibilityresults_client_example_test.go +++ /dev/null @@ -1,100 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEligibilityResults_List.json -func ExampleReplicationEligibilityResultsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationEligibilityResultsClient().List(ctx, "testRg1", "testVm2", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationEligibilityResultsCollection = armrecoveryservicessiterecovery.ReplicationEligibilityResultsCollection{ - // Value: []*armrecoveryservicessiterecovery.ReplicationEligibilityResults{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.RecoveryServices/replicationEligibilityResults"), - // ID: to.Ptr("/subscriptions/d90d145a-4cdd-45a3-b2c4-971d69775278/resourceGroups/testRg1/providers/Microsoft.Compute/virtualMachines/testVm2/providers/Microsoft.RecoveryServices/replicationEligibilityResults/default"), - // Properties: &armrecoveryservicessiterecovery.ReplicationEligibilityResultsProperties{ - // ClientRequestID: to.Ptr("a62c81df-e26e-47ea-ab4b-f1fcc1e5b135"), - // Errors: []*armrecoveryservicessiterecovery.ReplicationEligibilityResultsErrorInfo{ - // { - // Code: to.Ptr("AzureVmIsNotInDesiredProvisioningState"), - // Message: to.Ptr("Azure virtual machine with Id (/subscriptions/d90d145a-4cdd-45a3-b2c4-971d69775278/resourceGroups/testRg1/providers/Microsoft.Compute/virtualMachines/testVm2) is with provisioning state 'failed'. To enable replication, VM's provisioning state should be 'succeeded'."), - // PossibleCauses: to.Ptr("Virtual machine is not in desired state."), - // RecommendedAction: to.Ptr("\n Ensure that the VM's provisioning state is 'succeeded'.\n Refer to https://aka.ms/a2a-vm-state-issues to troubleshoot VM provisioning state issues.\n "), - // Status: to.Ptr("Error"), - // }, - // { - // Code: to.Ptr("AzureVmIsNotInDesiredPowerState"), - // Message: to.Ptr("Azure virtual machine with Id (/subscriptions/d90d145a-4cdd-45a3-b2c4-971d69775278/resourceGroups/testRg1/providers/Microsoft.Compute/virtualMachines/testVm2) is with power status 'deallocated'. To enable replication, VM's power status should be 'running'."), - // PossibleCauses: to.Ptr("Virtual machine is not in desired state."), - // RecommendedAction: to.Ptr("\n Ensure that the VM's power status is 'running'.\n You can check the power status in 'VM > Settings > Properties > Status' in Azure portal.\n "), - // Status: to.Ptr("Error"), - // }}, - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEligibilityResults_Get.json -func ExampleReplicationEligibilityResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationEligibilityResultsClient().Get(ctx, "testRg1", "testVm1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationEligibilityResults = armrecoveryservicessiterecovery.ReplicationEligibilityResults{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.RecoveryServices/replicationEligibilityResults"), - // ID: to.Ptr("/subscriptions/d90d145a-4cdd-45a3-b2c4-971d69775278/resourceGroups/testRg1/providers/Microsoft.Compute/virtualMachines/testVm1/providers/Microsoft.RecoveryServices/replicationEligibilityResults/default"), - // Properties: &armrecoveryservicessiterecovery.ReplicationEligibilityResultsProperties{ - // ClientRequestID: to.Ptr("7d72ade7-b9f7-4d9b-8a19-15d9728c6190"), - // Errors: []*armrecoveryservicessiterecovery.ReplicationEligibilityResultsErrorInfo{ - // { - // Code: to.Ptr("A2AOperatingSystemNotSupported"), - // Message: to.Ptr("The A2A operation could not be completed as the virtual machine is running OS 'ubuntu' with version '18.04' which is not supported for replication."), - // PossibleCauses: to.Ptr("OS version not supported."), - // RecommendedAction: to.Ptr("The virtual machine is running unsupported Operating system. Refer to the documentation for supported OS versions - https://aka.ms/a2a-os-support-matrix."), - // Status: to.Ptr("Error"), - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationevents_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationevents_client.go index 60bf8da01066..604b84446890 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationevents_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationevents_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -47,24 +46,27 @@ func NewReplicationEventsClient(subscriptionID string, credential azcore.TokenCr // Get - The operation to get the details of an Azure Site recovery event. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - eventName - The name of the Azure Site Recovery event. // - options - ReplicationEventsClientGetOptions contains the optional parameters for the ReplicationEventsClient.Get method. func (client *ReplicationEventsClient) Get(ctx context.Context, resourceName string, resourceGroupName string, eventName string, options *ReplicationEventsClientGetOptions) (ReplicationEventsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, eventName, options) if err != nil { return ReplicationEventsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationEventsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationEventsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationEventsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -91,7 +93,7 @@ func (client *ReplicationEventsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -108,7 +110,7 @@ func (client *ReplicationEventsClient) getHandleResponse(resp *http.Response) (R // NewListPager - Gets the list of Azure Site Recovery events for the vault. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ReplicationEventsClientListOptions contains the optional parameters for the ReplicationEventsClient.NewListPager @@ -161,7 +163,7 @@ func (client *ReplicationEventsClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationevents_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationevents_client_example_test.go deleted file mode 100644 index e88d7b16cab8..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationevents_client_example_test.go +++ /dev/null @@ -1,137 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEvents_List.json -func ExampleReplicationEventsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationEventsClient().NewListPager("vault1", "resourceGroupPS1", &armrecoveryservicessiterecovery.ReplicationEventsClientListOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.EventCollection = armrecoveryservicessiterecovery.EventCollection{ - // Value: []*armrecoveryservicessiterecovery.Event{ - // { - // Name: to.Ptr("JobStatusMonitoringEvent;9091989892524070155_4ed6f1a6-9b6d-4048-9079-1307dd24b814"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationEvents"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationEvents/JobStatusMonitoringEvent;9091989892524070155_4ed6f1a6-9b6d-4048-9079-1307dd24b814"), - // Properties: &armrecoveryservicessiterecovery.EventProperties{ - // Description: to.Ptr("TestFailover - Failed"), - // AffectedObjectFriendlyName: to.Ptr("vm1"), - // EventCode: to.Ptr("d32574f6-f59e-4545-b5ac-bc88d545f089"), - // EventSpecificDetails: &armrecoveryservicessiterecovery.JobStatusEventDetails{ - // InstanceType: to.Ptr("JobStatus"), - // }, - // EventType: to.Ptr("JobStatus"), - // FabricID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1"), - // HealthErrors: []*armrecoveryservicessiterecovery.HealthError{ - // { - // ErrorCode: to.Ptr("499"), - // ErrorMessage: to.Ptr("An internal error occurred."), - // PossibleCauses: to.Ptr("The operation failed due to an internal error."), - // RecommendedAction: to.Ptr("Retry the last action. If the issue persists, contact Support."), - // }}, - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzureEventDetails{ - // InstanceType: to.Ptr("HyperVReplicaAzure"), - // }, - // Severity: to.Ptr("Critical"), - // TimeOfOccurrence: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-02T16:00:33.0705652Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("VmMonitoringEvent;9091989947769704276_516de684-0079-48f7-b44b-882923268654"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationEvents"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationEvents/VmMonitoringEvent;9091989947769704276_516de684-0079-48f7-b44b-882923268654"), - // Properties: &armrecoveryservicessiterecovery.EventProperties{ - // Description: to.Ptr("Virtual machine health is OK"), - // AffectedObjectFriendlyName: to.Ptr("vm1"), - // EventCode: to.Ptr("d9a07b07-c7b5-49ca-ab6c-6926596dfe47"), - // EventSpecificDetails: &armrecoveryservicessiterecovery.JobStatusEventDetails{ - // InstanceType: to.Ptr("JobStatus"), - // }, - // EventType: to.Ptr("VmHealth"), - // FabricID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1"), - // HealthErrors: []*armrecoveryservicessiterecovery.HealthError{ - // }, - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzureEventDetails{ - // InstanceType: to.Ptr("HyperVReplicaAzure"), - // }, - // Severity: to.Ptr("OK"), - // TimeOfOccurrence: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-02T14:28:28.5071531Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEvents_Get.json -func ExampleReplicationEventsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationEventsClient().Get(ctx, "vault1", "resourceGroupPS1", "654b71d0-b2ce-4e6e-a861-98528d4bd375", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Event = armrecoveryservicessiterecovery.Event{ - // Name: to.Ptr("VmMonitoringEvent;9091989947769704276_516de684-0079-48f7-b44b-882923268654"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationEvents"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationEvents/VmMonitoringEvent;9091989947769704276_516de684-0079-48f7-b44b-882923268654"), - // Properties: &armrecoveryservicessiterecovery.EventProperties{ - // Description: to.Ptr("Virtual machine health is OK"), - // AffectedObjectFriendlyName: to.Ptr("vm1"), - // EventCode: to.Ptr("d9a07b07-c7b5-49ca-ab6c-6926596dfe47"), - // EventSpecificDetails: &armrecoveryservicessiterecovery.JobStatusEventDetails{ - // InstanceType: to.Ptr("JobStatus"), - // }, - // EventType: to.Ptr("VmHealth"), - // FabricID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1"), - // HealthErrors: []*armrecoveryservicessiterecovery.HealthError{ - // }, - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzureEventDetails{ - // InstanceType: to.Ptr("HyperVReplicaAzure"), - // }, - // Severity: to.Ptr("OK"), - // TimeOfOccurrence: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-02T14:28:28.5071531Z"); return t}()), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationfabrics_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationfabrics_client.go index a1b52415248b..915f1ce5141d 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationfabrics_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationfabrics_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -47,7 +46,7 @@ func NewReplicationFabricsClient(subscriptionID string, credential azcore.TokenC // BeginCheckConsistency - The operation to perform a consistency check on the fabric. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -59,7 +58,8 @@ func (client *ReplicationFabricsClient) BeginCheckConsistency(ctx context.Contex if err != nil { return nil, err } - return runtime.NewPoller[ReplicationFabricsClientCheckConsistencyResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationFabricsClientCheckConsistencyResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationFabricsClientCheckConsistencyResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -68,20 +68,22 @@ func (client *ReplicationFabricsClient) BeginCheckConsistency(ctx context.Contex // CheckConsistency - The operation to perform a consistency check on the fabric. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationFabricsClient) checkConsistency(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *ReplicationFabricsClientBeginCheckConsistencyOptions) (*http.Response, error) { + var err error req, err := client.checkConsistencyCreateRequest(ctx, resourceName, resourceGroupName, fabricName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // checkConsistencyCreateRequest creates the CheckConsistency request. @@ -108,7 +110,7 @@ func (client *ReplicationFabricsClient) checkConsistencyCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,7 +119,7 @@ func (client *ReplicationFabricsClient) checkConsistencyCreateRequest(ctx contex // BeginCreate - The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Name of the ASR fabric. @@ -130,7 +132,8 @@ func (client *ReplicationFabricsClient) BeginCreate(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller[ReplicationFabricsClientCreateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationFabricsClientCreateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationFabricsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -139,20 +142,22 @@ func (client *ReplicationFabricsClient) BeginCreate(ctx context.Context, resourc // Create - The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationFabricsClient) create(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, input FabricCreationInput, options *ReplicationFabricsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, fabricName, input, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -179,16 +184,19 @@ func (client *ReplicationFabricsClient) createCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, input) + if err := runtime.MarshalAsJSON(req, input); err != nil { + return nil, err + } + return req, nil } // BeginDelete - The operation to delete or remove an Azure Site Recovery fabric. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - ASR fabric to delete. @@ -200,7 +208,8 @@ func (client *ReplicationFabricsClient) BeginDelete(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller[ReplicationFabricsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationFabricsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationFabricsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -209,20 +218,22 @@ func (client *ReplicationFabricsClient) BeginDelete(ctx context.Context, resourc // Delete - The operation to delete or remove an Azure Site Recovery fabric. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationFabricsClient) deleteOperation(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *ReplicationFabricsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceName, resourceGroupName, fabricName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -249,7 +260,7 @@ func (client *ReplicationFabricsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -257,24 +268,27 @@ func (client *ReplicationFabricsClient) deleteCreateRequest(ctx context.Context, // Get - Gets the details of an Azure Site Recovery fabric. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. // - options - ReplicationFabricsClientGetOptions contains the optional parameters for the ReplicationFabricsClient.Get method. func (client *ReplicationFabricsClient) Get(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *ReplicationFabricsClientGetOptions) (ReplicationFabricsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, options) if err != nil { return ReplicationFabricsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationFabricsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationFabricsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationFabricsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -301,7 +315,7 @@ func (client *ReplicationFabricsClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -321,7 +335,7 @@ func (client *ReplicationFabricsClient) getHandleResponse(resp *http.Response) ( // NewListPager - Gets a list of the Azure Site Recovery fabrics in the vault. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ReplicationFabricsClientListOptions contains the optional parameters for the ReplicationFabricsClient.NewListPager @@ -374,7 +388,7 @@ func (client *ReplicationFabricsClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -392,7 +406,7 @@ func (client *ReplicationFabricsClient) listHandleResponse(resp *http.Response) // BeginMigrateToAAD - The operation to migrate an Azure Site Recovery fabric to AAD. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - ASR fabric to migrate. @@ -404,7 +418,8 @@ func (client *ReplicationFabricsClient) BeginMigrateToAAD(ctx context.Context, r if err != nil { return nil, err } - return runtime.NewPoller[ReplicationFabricsClientMigrateToAADResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationFabricsClientMigrateToAADResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationFabricsClientMigrateToAADResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -413,20 +428,22 @@ func (client *ReplicationFabricsClient) BeginMigrateToAAD(ctx context.Context, r // MigrateToAAD - The operation to migrate an Azure Site Recovery fabric to AAD. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationFabricsClient) migrateToAAD(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *ReplicationFabricsClientBeginMigrateToAADOptions) (*http.Response, error) { + var err error req, err := client.migrateToAADCreateRequest(ctx, resourceName, resourceGroupName, fabricName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // migrateToAADCreateRequest creates the MigrateToAAD request. @@ -453,7 +470,7 @@ func (client *ReplicationFabricsClient) migrateToAADCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -461,7 +478,7 @@ func (client *ReplicationFabricsClient) migrateToAADCreateRequest(ctx context.Co // BeginPurge - The operation to purge(force delete) an Azure Site Recovery fabric. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - ASR fabric to purge. @@ -473,7 +490,8 @@ func (client *ReplicationFabricsClient) BeginPurge(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller[ReplicationFabricsClientPurgeResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationFabricsClientPurgeResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationFabricsClientPurgeResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -482,20 +500,22 @@ func (client *ReplicationFabricsClient) BeginPurge(ctx context.Context, resource // Purge - The operation to purge(force delete) an Azure Site Recovery fabric. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationFabricsClient) purge(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *ReplicationFabricsClientBeginPurgeOptions) (*http.Response, error) { + var err error req, err := client.purgeCreateRequest(ctx, resourceName, resourceGroupName, fabricName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // purgeCreateRequest creates the Purge request. @@ -522,7 +542,7 @@ func (client *ReplicationFabricsClient) purgeCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -530,7 +550,7 @@ func (client *ReplicationFabricsClient) purgeCreateRequest(ctx context.Context, // BeginReassociateGateway - The operation to move replications from a process server to another process server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - The name of the fabric containing the process server. @@ -543,7 +563,8 @@ func (client *ReplicationFabricsClient) BeginReassociateGateway(ctx context.Cont if err != nil { return nil, err } - return runtime.NewPoller[ReplicationFabricsClientReassociateGatewayResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationFabricsClientReassociateGatewayResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationFabricsClientReassociateGatewayResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -552,20 +573,22 @@ func (client *ReplicationFabricsClient) BeginReassociateGateway(ctx context.Cont // ReassociateGateway - The operation to move replications from a process server to another process server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationFabricsClient) reassociateGateway(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, failoverProcessServerRequest FailoverProcessServerRequest, options *ReplicationFabricsClientBeginReassociateGatewayOptions) (*http.Response, error) { + var err error req, err := client.reassociateGatewayCreateRequest(ctx, resourceName, resourceGroupName, fabricName, failoverProcessServerRequest, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // reassociateGatewayCreateRequest creates the ReassociateGateway request. @@ -592,16 +615,19 @@ func (client *ReplicationFabricsClient) reassociateGatewayCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, failoverProcessServerRequest) + if err := runtime.MarshalAsJSON(req, failoverProcessServerRequest); err != nil { + return nil, err + } + return req, nil } // BeginRenewCertificate - Renews the connection certificate for the ASR replication fabric. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - fabric name to renew certs for. @@ -614,7 +640,8 @@ func (client *ReplicationFabricsClient) BeginRenewCertificate(ctx context.Contex if err != nil { return nil, err } - return runtime.NewPoller[ReplicationFabricsClientRenewCertificateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationFabricsClientRenewCertificateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationFabricsClientRenewCertificateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -623,20 +650,22 @@ func (client *ReplicationFabricsClient) BeginRenewCertificate(ctx context.Contex // RenewCertificate - Renews the connection certificate for the ASR replication fabric. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationFabricsClient) renewCertificate(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, renewCertificate RenewCertificateInput, options *ReplicationFabricsClientBeginRenewCertificateOptions) (*http.Response, error) { + var err error req, err := client.renewCertificateCreateRequest(ctx, resourceName, resourceGroupName, fabricName, renewCertificate, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // renewCertificateCreateRequest creates the RenewCertificate request. @@ -663,8 +692,11 @@ func (client *ReplicationFabricsClient) renewCertificateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, renewCertificate) + if err := runtime.MarshalAsJSON(req, renewCertificate); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationfabrics_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationfabrics_client_example_test.go deleted file mode 100644 index 3be6ff31209c..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationfabrics_client_example_test.go +++ /dev/null @@ -1,378 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_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/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_List.json -func ExampleReplicationFabricsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationFabricsClient().NewListPager("vault1", "resourceGroupPS1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FabricCollection = armrecoveryservicessiterecovery.FabricCollection{ - // Value: []*armrecoveryservicessiterecovery.Fabric{ - // { - // Name: to.Ptr("cloud1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1"), - // Properties: &armrecoveryservicessiterecovery.FabricProperties{ - // BcdrState: to.Ptr("Valid"), - // CustomDetails: &armrecoveryservicessiterecovery.HyperVSiteDetails{ - // InstanceType: to.Ptr("HyperVSite"), - // }, - // EncryptionDetails: &armrecoveryservicessiterecovery.EncryptionDetails{ - // KekState: to.Ptr("None"), - // }, - // FriendlyName: to.Ptr("cloud1"), - // Health: to.Ptr("Normal"), - // HealthErrorDetails: []*armrecoveryservicessiterecovery.HealthError{ - // }, - // InternalIdentifier: to.Ptr("6d224fc6-f326-5d35-96de-fbf51efb3179"), - // RolloverEncryptionDetails: &armrecoveryservicessiterecovery.EncryptionDetails{ - // KekState: to.Ptr("None"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Get.json -func ExampleReplicationFabricsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationFabricsClient().Get(ctx, "vault1", "resourceGroupPS1", "cloud1", &armrecoveryservicessiterecovery.ReplicationFabricsClientGetOptions{Filter: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Fabric = armrecoveryservicessiterecovery.Fabric{ - // Name: to.Ptr("cloud1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1"), - // Properties: &armrecoveryservicessiterecovery.FabricProperties{ - // BcdrState: to.Ptr("Valid"), - // CustomDetails: &armrecoveryservicessiterecovery.HyperVSiteDetails{ - // InstanceType: to.Ptr("HyperVSite"), - // }, - // EncryptionDetails: &armrecoveryservicessiterecovery.EncryptionDetails{ - // KekState: to.Ptr("None"), - // }, - // FriendlyName: to.Ptr("cloud1"), - // Health: to.Ptr("Normal"), - // HealthErrorDetails: []*armrecoveryservicessiterecovery.HealthError{ - // }, - // InternalIdentifier: to.Ptr("6d224fc6-f326-5d35-96de-fbf51efb3179"), - // RolloverEncryptionDetails: &armrecoveryservicessiterecovery.EncryptionDetails{ - // KekState: to.Ptr("None"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Create.json -func ExampleReplicationFabricsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationFabricsClient().BeginCreate(ctx, "vault1", "resourceGroupPS1", "cloud1", armrecoveryservicessiterecovery.FabricCreationInput{ - Properties: &armrecoveryservicessiterecovery.FabricCreationInputProperties{ - CustomDetails: &armrecoveryservicessiterecovery.FabricSpecificCreationInput{ - InstanceType: to.Ptr("FabricSpecificCreationInput"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Fabric = armrecoveryservicessiterecovery.Fabric{ - // Name: to.Ptr("cloud1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1"), - // Properties: &armrecoveryservicessiterecovery.FabricProperties{ - // BcdrState: to.Ptr("Valid"), - // CustomDetails: &armrecoveryservicessiterecovery.HyperVSiteDetails{ - // InstanceType: to.Ptr("HyperVSite"), - // }, - // EncryptionDetails: &armrecoveryservicessiterecovery.EncryptionDetails{ - // KekState: to.Ptr("None"), - // }, - // FriendlyName: to.Ptr("cloud1"), - // Health: to.Ptr("Normal"), - // HealthErrorDetails: []*armrecoveryservicessiterecovery.HealthError{ - // }, - // InternalIdentifier: to.Ptr("6d224fc6-f326-5d35-96de-fbf51efb3179"), - // RolloverEncryptionDetails: &armrecoveryservicessiterecovery.EncryptionDetails{ - // KekState: to.Ptr("None"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Purge.json -func ExampleReplicationFabricsClient_BeginPurge() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationFabricsClient().BeginPurge(ctx, "vault1", "resourceGroupPS1", "cloud1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_CheckConsistency.json -func ExampleReplicationFabricsClient_BeginCheckConsistency() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationFabricsClient().BeginCheckConsistency(ctx, "vault1", "resourceGroupPS1", "cloud1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Fabric = armrecoveryservicessiterecovery.Fabric{ - // Name: to.Ptr("cloud1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1"), - // Properties: &armrecoveryservicessiterecovery.FabricProperties{ - // BcdrState: to.Ptr("Valid"), - // CustomDetails: &armrecoveryservicessiterecovery.HyperVSiteDetails{ - // InstanceType: to.Ptr("HyperVSite"), - // }, - // EncryptionDetails: &armrecoveryservicessiterecovery.EncryptionDetails{ - // KekState: to.Ptr("None"), - // }, - // FriendlyName: to.Ptr("cloud1"), - // Health: to.Ptr("Normal"), - // HealthErrorDetails: []*armrecoveryservicessiterecovery.HealthError{ - // }, - // InternalIdentifier: to.Ptr("6d224fc6-f326-5d35-96de-fbf51efb3179"), - // RolloverEncryptionDetails: &armrecoveryservicessiterecovery.EncryptionDetails{ - // KekState: to.Ptr("None"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_MigrateToAad.json -func ExampleReplicationFabricsClient_BeginMigrateToAAD() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationFabricsClient().BeginMigrateToAAD(ctx, "vault1", "resourceGroupPS1", "cloud1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_ReassociateGateway.json -func ExampleReplicationFabricsClient_BeginReassociateGateway() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationFabricsClient().BeginReassociateGateway(ctx, "MadhaviVault", "MadhaviVRG", "GRACE-V2A-1", armrecoveryservicessiterecovery.FailoverProcessServerRequest{ - Properties: &armrecoveryservicessiterecovery.FailoverProcessServerRequestProperties{ - ContainerName: to.Ptr("cloud_1f3c15af-2256-4568-9e06-e1ef4f728f75"), - SourceProcessServerID: to.Ptr("AFA0EC54-1894-4E44-9CAB02DB8854B117"), - TargetProcessServerID: to.Ptr("5D3ED340-85AE-C646-B338641E015DA405"), - UpdateType: to.Ptr("ServerLevel"), - VMsToMigrate: []*string{ - to.Ptr("Vm1"), - to.Ptr("Vm2")}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Fabric = armrecoveryservicessiterecovery.Fabric{ - // Name: to.Ptr("bc15edf300344660d9c2965f5d9225593d99734f6580613c997033abc3512a56"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics"), - // ID: to.Ptr("/Subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/MadhaviVRG/providers/Microsoft.RecoveryServices/vaults/MadhaviVault/replicationFabrics/bc15edf300344660d9c2965f5d9225593d99734f6580613c997033abc3512a56"), - // Properties: &armrecoveryservicessiterecovery.FabricProperties{ - // BcdrState: to.Ptr("Valid"), - // CustomDetails: &armrecoveryservicessiterecovery.VMwareDetails{ - // InstanceType: to.Ptr("VMware"), - // }, - // EncryptionDetails: &armrecoveryservicessiterecovery.EncryptionDetails{ - // KekState: to.Ptr("None"), - // }, - // FriendlyName: to.Ptr("GRACE-V2A-1"), - // Health: to.Ptr("Normal"), - // HealthErrorDetails: []*armrecoveryservicessiterecovery.HealthError{ - // }, - // InternalIdentifier: to.Ptr("1f3c15af-2256-4568-9e06-e1ef4f728f75"), - // RolloverEncryptionDetails: &armrecoveryservicessiterecovery.EncryptionDetails{ - // KekState: to.Ptr("None"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Delete.json -func ExampleReplicationFabricsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationFabricsClient().BeginDelete(ctx, "vault1", "resourceGroupPS1", "cloud1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_RenewCertificate.json -func ExampleReplicationFabricsClient_BeginRenewCertificate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationFabricsClient().BeginRenewCertificate(ctx, "vault1", "resourceGroupPS1", "cloud1", armrecoveryservicessiterecovery.RenewCertificateInput{ - Properties: &armrecoveryservicessiterecovery.RenewCertificateInputProperties{ - RenewCertificateType: to.Ptr("Cloud"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Fabric = armrecoveryservicessiterecovery.Fabric{ - // Name: to.Ptr("cloud1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1"), - // Properties: &armrecoveryservicessiterecovery.FabricProperties{ - // BcdrState: to.Ptr("Valid"), - // CustomDetails: &armrecoveryservicessiterecovery.HyperVSiteDetails{ - // InstanceType: to.Ptr("HyperVSite"), - // }, - // EncryptionDetails: &armrecoveryservicessiterecovery.EncryptionDetails{ - // KekState: to.Ptr("None"), - // }, - // FriendlyName: to.Ptr("cloud1"), - // Health: to.Ptr("Normal"), - // HealthErrorDetails: []*armrecoveryservicessiterecovery.HealthError{ - // }, - // InternalIdentifier: to.Ptr("6d224fc6-f326-5d35-96de-fbf51efb3179"), - // RolloverEncryptionDetails: &armrecoveryservicessiterecovery.EncryptionDetails{ - // KekState: to.Ptr("None"), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationjobs_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationjobs_client.go index 8b6376f64c60..c7de2b3cf758 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationjobs_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationjobs_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -47,7 +46,7 @@ func NewReplicationJobsClient(subscriptionID string, credential azcore.TokenCred // BeginCancel - The operation to cancel an Azure Site Recovery job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - jobName - Job identifier. @@ -59,7 +58,8 @@ func (client *ReplicationJobsClient) BeginCancel(ctx context.Context, resourceNa if err != nil { return nil, err } - return runtime.NewPoller[ReplicationJobsClientCancelResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationJobsClientCancelResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationJobsClientCancelResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -68,20 +68,22 @@ func (client *ReplicationJobsClient) BeginCancel(ctx context.Context, resourceNa // Cancel - The operation to cancel an Azure Site Recovery job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationJobsClient) cancel(ctx context.Context, resourceName string, resourceGroupName string, jobName string, options *ReplicationJobsClientBeginCancelOptions) (*http.Response, error) { + var err error req, err := client.cancelCreateRequest(ctx, resourceName, resourceGroupName, jobName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // cancelCreateRequest creates the Cancel request. @@ -108,7 +110,7 @@ func (client *ReplicationJobsClient) cancelCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,7 +119,7 @@ func (client *ReplicationJobsClient) cancelCreateRequest(ctx context.Context, re // BeginExport - The operation to export the details of the Azure Site Recovery jobs of the vault. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - jobQueryParameter - job query filter. @@ -129,7 +131,8 @@ func (client *ReplicationJobsClient) BeginExport(ctx context.Context, resourceNa if err != nil { return nil, err } - return runtime.NewPoller[ReplicationJobsClientExportResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationJobsClientExportResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationJobsClientExportResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -138,20 +141,22 @@ func (client *ReplicationJobsClient) BeginExport(ctx context.Context, resourceNa // Export - The operation to export the details of the Azure Site Recovery jobs of the vault. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationJobsClient) export(ctx context.Context, resourceName string, resourceGroupName string, jobQueryParameter JobQueryParameter, options *ReplicationJobsClientBeginExportOptions) (*http.Response, error) { + var err error req, err := client.exportCreateRequest(ctx, resourceName, resourceGroupName, jobQueryParameter, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // exportCreateRequest creates the Export request. @@ -174,33 +179,39 @@ func (client *ReplicationJobsClient) exportCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, jobQueryParameter) + if err := runtime.MarshalAsJSON(req, jobQueryParameter); err != nil { + return nil, err + } + return req, nil } // Get - Get the details of an Azure Site Recovery job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - jobName - Job identifier. // - options - ReplicationJobsClientGetOptions contains the optional parameters for the ReplicationJobsClient.Get method. func (client *ReplicationJobsClient) Get(ctx context.Context, resourceName string, resourceGroupName string, jobName string, options *ReplicationJobsClientGetOptions) (ReplicationJobsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, jobName, options) if err != nil { return ReplicationJobsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationJobsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationJobsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationJobsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -227,7 +238,7 @@ func (client *ReplicationJobsClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -244,7 +255,7 @@ func (client *ReplicationJobsClient) getHandleResponse(resp *http.Response) (Rep // NewListPager - Gets the list of Azure Site Recovery Jobs for the vault. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ReplicationJobsClientListOptions contains the optional parameters for the ReplicationJobsClient.NewListPager @@ -297,7 +308,7 @@ func (client *ReplicationJobsClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -318,7 +329,7 @@ func (client *ReplicationJobsClient) listHandleResponse(resp *http.Response) (Re // BeginRestart - The operation to restart an Azure Site Recovery job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - jobName - Job identifier. @@ -330,7 +341,8 @@ func (client *ReplicationJobsClient) BeginRestart(ctx context.Context, resourceN if err != nil { return nil, err } - return runtime.NewPoller[ReplicationJobsClientRestartResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationJobsClientRestartResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationJobsClientRestartResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -339,20 +351,22 @@ func (client *ReplicationJobsClient) BeginRestart(ctx context.Context, resourceN // Restart - The operation to restart an Azure Site Recovery job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationJobsClient) restart(ctx context.Context, resourceName string, resourceGroupName string, jobName string, options *ReplicationJobsClientBeginRestartOptions) (*http.Response, error) { + var err error req, err := client.restartCreateRequest(ctx, resourceName, resourceGroupName, jobName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // restartCreateRequest creates the Restart request. @@ -379,7 +393,7 @@ func (client *ReplicationJobsClient) restartCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -388,7 +402,7 @@ func (client *ReplicationJobsClient) restartCreateRequest(ctx context.Context, r // BeginResume - The operation to resume an Azure Site Recovery job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - jobName - Job identifier. @@ -401,7 +415,8 @@ func (client *ReplicationJobsClient) BeginResume(ctx context.Context, resourceNa if err != nil { return nil, err } - return runtime.NewPoller[ReplicationJobsClientResumeResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationJobsClientResumeResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationJobsClientResumeResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -410,20 +425,22 @@ func (client *ReplicationJobsClient) BeginResume(ctx context.Context, resourceNa // Resume - The operation to resume an Azure Site Recovery job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationJobsClient) resume(ctx context.Context, resourceName string, resourceGroupName string, jobName string, resumeJobParams ResumeJobParams, options *ReplicationJobsClientBeginResumeOptions) (*http.Response, error) { + var err error req, err := client.resumeCreateRequest(ctx, resourceName, resourceGroupName, jobName, resumeJobParams, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // resumeCreateRequest creates the Resume request. @@ -450,8 +467,11 @@ func (client *ReplicationJobsClient) resumeCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resumeJobParams) + if err := runtime.MarshalAsJSON(req, resumeJobParams); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationjobs_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationjobs_client_example_test.go deleted file mode 100644 index 13b8886ce6f3..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationjobs_client_example_test.go +++ /dev/null @@ -1,452 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_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/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_List.json -func ExampleReplicationJobsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationJobsClient().NewListPager("vault1", "resourceGroupPS1", &armrecoveryservicessiterecovery.ReplicationJobsClientListOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JobCollection = armrecoveryservicessiterecovery.JobCollection{ - // Value: []*armrecoveryservicessiterecovery.Job{ - // { - // Name: to.Ptr("1557d73f-6244-491e-8f0b-d300f752240b"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/1557d73f-6244-491e-8f0b-d300f752240b"), - // Properties: &armrecoveryservicessiterecovery.JobProperties{ - // AllowedActions: []*string{ - // }, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T12:46:11Z"); return t}()), - // Errors: []*armrecoveryservicessiterecovery.JobErrorDetails{ - // }, - // FriendlyName: to.Ptr("Create replication policy"), - // ScenarioName: to.Ptr("AddProtectionProfile"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T12:46:04.641851Z"); return t}()), - // State: to.Ptr("Succeeded"), - // StateDescription: to.Ptr("Completed"), - // TargetInstanceType: to.Ptr("ProtectionProfile"), - // TargetObjectID: to.Ptr("af095a1e-1f1b-5365-87c9-99162ebcfaf0"), - // TargetObjectName: to.Ptr("protectionprofile1"), - // Tasks: []*armrecoveryservicessiterecovery.ASRTask{ - // }, - // }, - // }, - // { - // Name: to.Ptr("0236416a-7573-4913-a4a1-6a286fbb1ceb"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/0236416a-7573-4913-a4a1-6a286fbb1ceb"), - // Properties: &armrecoveryservicessiterecovery.JobProperties{ - // AllowedActions: []*string{ - // }, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-02T14:07:21Z"); return t}()), - // Errors: []*armrecoveryservicessiterecovery.JobErrorDetails{ - // }, - // FriendlyName: to.Ptr("Register the Azure Site Recovery Provider"), - // ScenarioName: to.Ptr("RegisterDra"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-02T14:07:19.2784338Z"); return t}()), - // State: to.Ptr("Succeeded"), - // StateDescription: to.Ptr("Completed"), - // TargetInstanceType: to.Ptr("Server"), - // TargetObjectID: to.Ptr("6d224fc6-f326-5d35-96de-fbf51efb3179"), - // TargetObjectName: to.Ptr("CP-B3L40406-12.ntdev.corp.microsoft.com"), - // Tasks: []*armrecoveryservicessiterecovery.ASRTask{ - // }, - // }, - // }, - // { - // Name: to.Ptr("2438d560-80f0-420b-839e-5c8ee0af90a1"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/2438d560-80f0-420b-839e-5c8ee0af90a1"), - // Properties: &armrecoveryservicessiterecovery.JobProperties{ - // AllowedActions: []*string{ - // }, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-02T05:56:16Z"); return t}()), - // Errors: []*armrecoveryservicessiterecovery.JobErrorDetails{ - // }, - // FriendlyName: to.Ptr("Create a site"), - // ScenarioName: to.Ptr("CreateSite"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-02T05:56:14.569095Z"); return t}()), - // State: to.Ptr("Succeeded"), - // StateDescription: to.Ptr("Completed"), - // TargetInstanceType: to.Ptr("Server"), - // TargetObjectID: to.Ptr("6d224fc6-f326-5d35-96de-fbf51efb3179"), - // TargetObjectName: to.Ptr("cloud1"), - // Tasks: []*armrecoveryservicessiterecovery.ASRTask{ - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Get.json -func ExampleReplicationJobsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationJobsClient().Get(ctx, "vault1", "resourceGroupPS1", "58776d0b-3141-48b2-a377-9ad863eb160d", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Job = armrecoveryservicessiterecovery.Job{ - // Name: to.Ptr("32ea4b9e-de62-49a1-b062-7864d5c3b897"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/32ea4b9e-de62-49a1-b062-7864d5c3b897"), - // Properties: &armrecoveryservicessiterecovery.JobProperties{ - // ActivityID: to.Ptr("fc8e9c8f-0e76-4b6b-8e7e-d37c1b31eba0 ActivityId: c506b6ba-0711-411e-8b09-1f3f4dcb824b"), - // AllowedActions: []*string{ - // }, - // CustomDetails: &armrecoveryservicessiterecovery.AsrJobDetails{ - // AffectedObjectDetails: map[string]*string{ - // "PrimaryFabricProviderId": to.Ptr("HyperVSite"), - // "PrimaryVmmId": to.Ptr("6d224fc6-f326-5d35-96de-fbf51efb3179"), - // "PrimaryVmmName": to.Ptr("cloud1"), - // "RecoveryFabricProviderId": to.Ptr("Azure"), - // "RecoveryVmmId": to.Ptr("21a9403c-6ec1-44f2-b744-b4e50b792387"), - // }, - // InstanceType: to.Ptr("AsrJobDetails"), - // }, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T11:25:57Z"); return t}()), - // Errors: []*armrecoveryservicessiterecovery.JobErrorDetails{ - // }, - // FriendlyName: to.Ptr("Delete a recovery plan"), - // ScenarioName: to.Ptr("DeleteRecoveryPlan"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T11:25:56.800358Z"); return t}()), - // State: to.Ptr("Succeeded"), - // StateDescription: to.Ptr("Completed"), - // TargetInstanceType: to.Ptr("RecoveryPlan"), - // TargetObjectID: to.Ptr("966c33bb-66e7-4567-9786-f80b0694f5f9"), - // TargetObjectName: to.Ptr("RPtest1"), - // Tasks: []*armrecoveryservicessiterecovery.ASRTask{ - // { - // Name: to.Ptr("DeleteRecoveryPlanTask"), - // AllowedActions: []*string{ - // }, - // CustomDetails: &armrecoveryservicessiterecovery.ManualActionTaskDetails{ - // InstanceType: to.Ptr("ManualActionTaskDetails"), - // }, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T11:25:57.318574Z"); return t}()), - // Errors: []*armrecoveryservicessiterecovery.JobErrorDetails{ - // }, - // FriendlyName: to.Ptr("Delete a recovery plan task"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T11:25:57.3029434Z"); return t}()), - // State: to.Ptr("Succeeded"), - // StateDescription: to.Ptr("Completed"), - // TaskID: to.Ptr("763326a2-01c9-4257-b2a1-0aac56465014"), - // TaskType: to.Ptr("TaskDetails"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Cancel.json -func ExampleReplicationJobsClient_BeginCancel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationJobsClient().BeginCancel(ctx, "vault1", "resourceGroupPS1", "2653c648-fc72-4316-86f3-fdf8eaa0066b", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Job = armrecoveryservicessiterecovery.Job{ - // Name: to.Ptr("2653c648-fc72-4316-86f3-fdf8eaa0066b"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/2653c648-fc72-4316-86f3-fdf8eaa0066b"), - // Properties: &armrecoveryservicessiterecovery.JobProperties{ - // ActivityID: to.Ptr("bfbbf6dd-9cbb-4cbc-98a6-faecc8891579 ActivityId: 07cc35ca-b63f-4e42-83c9-81ae0191c322"), - // AllowedActions: []*string{ - // }, - // CustomDetails: &armrecoveryservicessiterecovery.AsrJobDetails{ - // AffectedObjectDetails: map[string]*string{ - // "PrimaryCloudId": to.Ptr("cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"), - // "PrimaryCloudName": to.Ptr("cloud1"), - // "PrimaryFabricProviderId": to.Ptr("HyperVSite"), - // "PrimaryVmId": to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // "PrimaryVmName": to.Ptr("vm1"), - // "PrimaryVmmId": to.Ptr("6d224fc6-f326-5d35-96de-fbf51efb3179"), - // "PrimaryVmmName": to.Ptr("cloud1"), - // "ProtectionProfileId": to.Ptr("af095a1e-1f1b-5365-87c9-99162ebcfaf0"), - // "RecoveryCloudId": to.Ptr("d38048d4-b460-4791-8ece-108395ee8478"), - // "RecoveryCloudName": to.Ptr("Microsoft Azure"), - // "RecoveryFabricProviderId": to.Ptr("Azure"), - // "RecoveryVmId": to.Ptr(""), - // "RecoveryVmName": to.Ptr("vm1"), - // "RecoveryVmmId": to.Ptr("21a9403c-6ec1-44f2-b744-b4e50b792387"), - // "RecoveryVmmName": to.Ptr("Microsoft Azure"), - // }, - // InstanceType: to.Ptr("AsrJobDetails"), - // }, - // Errors: []*armrecoveryservicessiterecovery.JobErrorDetails{ - // }, - // FriendlyName: to.Ptr("Planned failover"), - // ScenarioName: to.Ptr("PlannedFailover"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-03T06:16:06.3235186Z"); return t}()), - // State: to.Ptr("Cancelling"), - // StateDescription: to.Ptr("Cancelling"), - // TargetInstanceType: to.Ptr("ProtectionEntity"), - // TargetObjectID: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // TargetObjectName: to.Ptr("vm1"), - // Tasks: []*armrecoveryservicessiterecovery.ASRTask{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Restart.json -func ExampleReplicationJobsClient_BeginRestart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationJobsClient().BeginRestart(ctx, "vault1", "resourceGroupPS1", "0664564c-353e-401a-ab0c-722257c10e25", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Job = armrecoveryservicessiterecovery.Job{ - // Name: to.Ptr("42c7d13b-790c-4609-8e0b-0936f1c5e5fb"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/42c7d13b-790c-4609-8e0b-0936f1c5e5fb"), - // Properties: &armrecoveryservicessiterecovery.JobProperties{ - // ActivityID: to.Ptr("2443a5b4-e675-499f-8983-4126ea0e232c ActivityId: 2a776896-5e56-470b-af55-3c981283c4bc"), - // AllowedActions: []*string{ - // }, - // CustomDetails: &armrecoveryservicessiterecovery.AsrJobDetails{ - // AffectedObjectDetails: map[string]*string{ - // }, - // InstanceType: to.Ptr("AsrJobDetails"), - // }, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-03T10:45:14Z"); return t}()), - // Errors: []*armrecoveryservicessiterecovery.JobErrorDetails{ - // }, - // FriendlyName: to.Ptr("Restart job"), - // ScenarioName: to.Ptr("RestartJob"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-03T10:45:12.1320757Z"); return t}()), - // State: to.Ptr("Succeeded"), - // StateDescription: to.Ptr("Completed"), - // TargetInstanceType: to.Ptr("ProtectionEntity"), - // TargetObjectID: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // TargetObjectName: to.Ptr("vm1"), - // Tasks: []*armrecoveryservicessiterecovery.ASRTask{ - // { - // Name: to.Ptr("RemediateTask"), - // AllowedActions: []*string{ - // }, - // CustomDetails: &armrecoveryservicessiterecovery.ManualActionTaskDetails{ - // InstanceType: to.Ptr("ManualActionTaskDetails"), - // }, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-03T10:45:13.6458467Z"); return t}()), - // Errors: []*armrecoveryservicessiterecovery.JobErrorDetails{ - // }, - // FriendlyName: to.Ptr("Restarting job"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-03T10:45:13.5677237Z"); return t}()), - // State: to.Ptr("Succeeded"), - // StateDescription: to.Ptr("Completed"), - // TaskID: to.Ptr("RemediateWfTask"), - // TaskType: to.Ptr("TaskDetails"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Resume.json -func ExampleReplicationJobsClient_BeginResume() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationJobsClient().BeginResume(ctx, "vault1", "resourceGroupPS1", "58776d0b-3141-48b2-a377-9ad863eb160d", armrecoveryservicessiterecovery.ResumeJobParams{ - Properties: &armrecoveryservicessiterecovery.ResumeJobParamsProperties{ - Comments: to.Ptr(" "), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Job = armrecoveryservicessiterecovery.Job{ - // Name: to.Ptr("58776d0b-3141-48b2-a377-9ad863eb160d"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/58776d0b-3141-48b2-a377-9ad863eb160d"), - // Properties: &armrecoveryservicessiterecovery.JobProperties{ - // ActivityID: to.Ptr("1b808dfe-0451-44ac-894c-c7270711cd8c ActivityId: 9f6f849e-922a-43ec-a7a6-0be45fc85c56"), - // AllowedActions: []*string{ - // to.Ptr("Cancel"), - // to.Ptr("Resume")}, - // CustomDetails: &armrecoveryservicessiterecovery.TestFailoverJobDetails{ - // AffectedObjectDetails: map[string]*string{ - // "PrimaryCloudId": to.Ptr("cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"), - // "PrimaryCloudName": to.Ptr("cloud1"), - // "PrimaryFabricProviderId": to.Ptr("HyperVSite"), - // "PrimaryVmId": to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // "PrimaryVmName": to.Ptr("vm1"), - // "PrimaryVmmId": to.Ptr("6d224fc6-f326-5d35-96de-fbf51efb3179"), - // "PrimaryVmmName": to.Ptr("cloud1"), - // "ProtectionProfileId": to.Ptr("af095a1e-1f1b-5365-87c9-99162ebcfaf0"), - // "RecoveryCloudId": to.Ptr("d38048d4-b460-4791-8ece-108395ee8478"), - // "RecoveryCloudName": to.Ptr("Microsoft Azure"), - // "RecoveryFabricProviderId": to.Ptr("Azure"), - // "RecoveryVmId": to.Ptr(""), - // "RecoveryVmName": to.Ptr("vm1"), - // "RecoveryVmmId": to.Ptr("21a9403c-6ec1-44f2-b744-b4e50b792387"), - // "RecoveryVmmName": to.Ptr("Microsoft Azure"), - // }, - // InstanceType: to.Ptr("TestFailoverJobDetails"), - // Comments: to.Ptr(" "), - // NetworkFriendlyName: to.Ptr("vnetavrai"), - // NetworkName: to.Ptr("vnetavrai"), - // NetworkType: to.Ptr("VmNetworkAsInput"), - // ProtectedItemDetails: []*armrecoveryservicessiterecovery.FailoverReplicationProtectedItemDetails{ - // { - // Name: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // FriendlyName: to.Ptr("vm1"), - // NetworkConnectionStatus: to.Ptr("Connected"), - // NetworkFriendlyName: to.Ptr("vnetavrai"), - // Subnet: to.Ptr("Subnet1"), - // TestVMFriendlyName: to.Ptr("vm1-test"), - // TestVMName: to.Ptr("vm1-test"), - // }}, - // TestFailoverStatus: to.Ptr("Completed"), - // }, - // Errors: []*armrecoveryservicessiterecovery.JobErrorDetails{ - // }, - // FriendlyName: to.Ptr("Test failover"), - // ScenarioName: to.Ptr("TestFailover"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-25T09:57:57.0357829Z"); return t}()), - // State: to.Ptr("Suspended"), - // StateDescription: to.Ptr("WaitingForStopTestFailover"), - // TargetInstanceType: to.Ptr("ProtectionEntity"), - // TargetObjectID: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // TargetObjectName: to.Ptr("vm1"), - // Tasks: []*armrecoveryservicessiterecovery.ASRTask{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Export.json -func ExampleReplicationJobsClient_BeginExport() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationJobsClient().BeginExport(ctx, "vault1", "resourceGroupPS1", armrecoveryservicessiterecovery.JobQueryParameter{ - AffectedObjectTypes: to.Ptr(""), - EndTime: to.Ptr("2017-05-04T14:26:51.9161395Z"), - JobStatus: to.Ptr(""), - StartTime: to.Ptr("2017-04-27T14:26:51.9161395Z"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Job = armrecoveryservicessiterecovery.Job{ - // Name: to.Ptr("37e0fc2b-13f2-4817-aafa-0cd807d46842"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/37e0fc2b-13f2-4817-aafa-0cd807d46842"), - // Properties: &armrecoveryservicessiterecovery.JobProperties{ - // ActivityID: to.Ptr("36841d27-34f6-49ad-b572-e7dc263f100b-2017-05-04 14:26:47Z-Ibz ActivityId: c124df21-7661-4541-b32a-3c723ebbb045"), - // AllowedActions: []*string{ - // }, - // CustomDetails: &armrecoveryservicessiterecovery.ExportJobDetails{ - // AffectedObjectDetails: map[string]*string{ - // }, - // InstanceType: to.Ptr("ExportJobDetails"), - // BlobURI: to.Ptr(""), - // SasToken: to.Ptr(""), - // }, - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-04T14:33:43Z"); return t}()), - // Errors: []*armrecoveryservicessiterecovery.JobErrorDetails{ - // }, - // ScenarioName: to.Ptr("ExportJobs"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-04T14:33:42.2765562Z"); return t}()), - // State: to.Ptr("Succeeded"), - // StateDescription: to.Ptr("Completed"), - // TargetInstanceType: to.Ptr("Other"), - // TargetObjectID: to.Ptr(""), - // TargetObjectName: to.Ptr(""), - // Tasks: []*armrecoveryservicessiterecovery.ASRTask{ - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationlogicalnetworks_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationlogicalnetworks_client.go index f09fb2d7f5da..1d834913f767 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationlogicalnetworks_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationlogicalnetworks_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -47,7 +46,7 @@ func NewReplicationLogicalNetworksClient(subscriptionID string, credential azcor // Get - Gets the details of a logical network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Server Id. @@ -55,18 +54,21 @@ func NewReplicationLogicalNetworksClient(subscriptionID string, credential azcor // - options - ReplicationLogicalNetworksClientGetOptions contains the optional parameters for the ReplicationLogicalNetworksClient.Get // method. func (client *ReplicationLogicalNetworksClient) Get(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, logicalNetworkName string, options *ReplicationLogicalNetworksClientGetOptions) (ReplicationLogicalNetworksClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, logicalNetworkName, options) if err != nil { return ReplicationLogicalNetworksClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationLogicalNetworksClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationLogicalNetworksClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationLogicalNetworksClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -97,7 +99,7 @@ func (client *ReplicationLogicalNetworksClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,7 +116,7 @@ func (client *ReplicationLogicalNetworksClient) getHandleResponse(resp *http.Res // NewListByReplicationFabricsPager - Lists all the logical networks of the Azure Site Recovery fabric. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Server Id. @@ -172,7 +174,7 @@ func (client *ReplicationLogicalNetworksClient) listByReplicationFabricsCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationlogicalnetworks_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationlogicalnetworks_client_example_test.go deleted file mode 100644 index c24defa616cc..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationlogicalnetworks_client_example_test.go +++ /dev/null @@ -1,99 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationLogicalNetworks_ListByReplicationFabrics.json -func ExampleReplicationLogicalNetworksClient_NewListByReplicationFabricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationLogicalNetworksClient().NewListByReplicationFabricsPager("vault1", "resourceGroupPS1", "cloud1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LogicalNetworkCollection = armrecoveryservicessiterecovery.LogicalNetworkCollection{ - // Value: []*armrecoveryservicessiterecovery.LogicalNetwork{ - // { - // Name: to.Ptr("87ab394f-165f-4aa9-bd84-b018500b4509"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationLogicalNetworks"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationLogicalNetworks/53f5a278-ae85-4001-bd5f-f6a02e1f579d"), - // Properties: &armrecoveryservicessiterecovery.LogicalNetworkProperties{ - // FriendlyName: to.Ptr("corp"), - // LogicalNetworkDefinitionsStatus: to.Ptr("LogicalNetworkDefinitionsNotIsolated"), - // LogicalNetworkUsage: to.Ptr("NotUsedAsPrivateNetworkForTestFailover"), - // NetworkVirtualizationStatus: to.Ptr("NetworkVirtualizationNotEnabled"), - // }, - // }, - // { - // Name: to.Ptr("53f5a278-ae85-4001-bd5f-f6a02e1f579d"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationLogicalNetworks"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationLogicalNetworks/87ab394f-165f-4aa9-bd84-b018500b4509"), - // Properties: &armrecoveryservicessiterecovery.LogicalNetworkProperties{ - // FriendlyName: to.Ptr("LN-VLANNetwork-4"), - // LogicalNetworkDefinitionsStatus: to.Ptr("LogicalNetworkDefinitionsIsolated"), - // LogicalNetworkUsage: to.Ptr("NotUsedAsPrivateNetworkForTestFailover"), - // NetworkVirtualizationStatus: to.Ptr("NetworkVirtualizationNotEnabled"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationLogicalNetworks_Get.json -func ExampleReplicationLogicalNetworksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationLogicalNetworksClient().Get(ctx, "vault1", "resourceGroupPS1", "cloud1", "87ab394f-165f-4aa9-bd84-b018500b4509", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LogicalNetwork = armrecoveryservicessiterecovery.LogicalNetwork{ - // Name: to.Ptr("87ab394f-165f-4aa9-bd84-b018500b4509"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationLogicalNetworks"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationLogicalNetworks/53f5a278-ae85-4001-bd5f-f6a02e1f579d"), - // Properties: &armrecoveryservicessiterecovery.LogicalNetworkProperties{ - // FriendlyName: to.Ptr("corp"), - // LogicalNetworkDefinitionsStatus: to.Ptr("LogicalNetworkDefinitionsNotIsolated"), - // LogicalNetworkUsage: to.Ptr("NotUsedAsPrivateNetworkForTestFailover"), - // NetworkVirtualizationStatus: to.Ptr("NetworkVirtualizationNotEnabled"), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationmigrationitems_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationmigrationitems_client.go index abd237d47ba2..e002e878c9a4 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationmigrationitems_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationmigrationitems_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -47,7 +46,7 @@ func NewReplicationMigrationItemsClient(subscriptionID string, credential azcore // BeginCreate - The operation to create an ASR migration item (enable migration). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -62,7 +61,8 @@ func (client *ReplicationMigrationItemsClient) BeginCreate(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[ReplicationMigrationItemsClientCreateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationMigrationItemsClientCreateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationMigrationItemsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ func (client *ReplicationMigrationItemsClient) BeginCreate(ctx context.Context, // Create - The operation to create an ASR migration item (enable migration). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationMigrationItemsClient) create(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, input EnableMigrationInput, options *ReplicationMigrationItemsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -119,16 +121,19 @@ func (client *ReplicationMigrationItemsClient) createCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, input) + if err := runtime.MarshalAsJSON(req, input); err != nil { + return nil, err + } + return req, nil } // BeginDelete - The operation to delete an ASR migration item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -142,7 +147,8 @@ func (client *ReplicationMigrationItemsClient) BeginDelete(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[ReplicationMigrationItemsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationMigrationItemsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationMigrationItemsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -151,20 +157,22 @@ func (client *ReplicationMigrationItemsClient) BeginDelete(ctx context.Context, // Delete - The operation to delete an ASR migration item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationMigrationItemsClient) deleteOperation(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, options *ReplicationMigrationItemsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -199,7 +207,7 @@ func (client *ReplicationMigrationItemsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") if options != nil && options.DeleteOption != nil { reqQP.Set("deleteOption", *options.DeleteOption) } @@ -210,7 +218,7 @@ func (client *ReplicationMigrationItemsClient) deleteCreateRequest(ctx context.C // Get - Gets the details of a migration item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric unique name. @@ -219,18 +227,21 @@ func (client *ReplicationMigrationItemsClient) deleteCreateRequest(ctx context.C // - options - ReplicationMigrationItemsClientGetOptions contains the optional parameters for the ReplicationMigrationItemsClient.Get // method. func (client *ReplicationMigrationItemsClient) Get(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, options *ReplicationMigrationItemsClientGetOptions) (ReplicationMigrationItemsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, options) if err != nil { return ReplicationMigrationItemsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationMigrationItemsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationMigrationItemsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationMigrationItemsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -265,7 +276,7 @@ func (client *ReplicationMigrationItemsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +293,7 @@ func (client *ReplicationMigrationItemsClient) getHandleResponse(resp *http.Resp // NewListPager - Gets the list of migration items in the vault. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ReplicationMigrationItemsClientListOptions contains the optional parameters for the ReplicationMigrationItemsClient.NewListPager @@ -335,7 +346,7 @@ func (client *ReplicationMigrationItemsClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") if options != nil && options.SkipToken != nil { reqQP.Set("skipToken", *options.SkipToken) } @@ -361,7 +372,7 @@ func (client *ReplicationMigrationItemsClient) listHandleResponse(resp *http.Res // NewListByReplicationProtectionContainersPager - Gets the list of ASR migration items in the protection container. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -424,7 +435,7 @@ func (client *ReplicationMigrationItemsClient) listByReplicationProtectionContai return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") if options != nil && options.SkipToken != nil { reqQP.Set("skipToken", *options.SkipToken) } @@ -451,7 +462,7 @@ func (client *ReplicationMigrationItemsClient) listByReplicationProtectionContai // BeginMigrate - The operation to initiate migration of the item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -466,7 +477,8 @@ func (client *ReplicationMigrationItemsClient) BeginMigrate(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[ReplicationMigrationItemsClientMigrateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationMigrationItemsClientMigrateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationMigrationItemsClientMigrateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -475,20 +487,22 @@ func (client *ReplicationMigrationItemsClient) BeginMigrate(ctx context.Context, // Migrate - The operation to initiate migration of the item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationMigrationItemsClient) migrate(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, migrateInput MigrateInput, options *ReplicationMigrationItemsClientBeginMigrateOptions) (*http.Response, error) { + var err error req, err := client.migrateCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, migrateInput, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // migrateCreateRequest creates the Migrate request. @@ -523,16 +537,19 @@ func (client *ReplicationMigrationItemsClient) migrateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, migrateInput) + if err := runtime.MarshalAsJSON(req, migrateInput); err != nil { + return nil, err + } + return req, nil } // BeginPauseReplication - The operation to initiate pause replication of the item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -547,7 +564,8 @@ func (client *ReplicationMigrationItemsClient) BeginPauseReplication(ctx context if err != nil { return nil, err } - return runtime.NewPoller[ReplicationMigrationItemsClientPauseReplicationResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationMigrationItemsClientPauseReplicationResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationMigrationItemsClientPauseReplicationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -556,20 +574,22 @@ func (client *ReplicationMigrationItemsClient) BeginPauseReplication(ctx context // PauseReplication - The operation to initiate pause replication of the item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationMigrationItemsClient) pauseReplication(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, pauseReplicationInput PauseReplicationInput, options *ReplicationMigrationItemsClientBeginPauseReplicationOptions) (*http.Response, error) { + var err error req, err := client.pauseReplicationCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, pauseReplicationInput, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // pauseReplicationCreateRequest creates the PauseReplication request. @@ -604,16 +624,19 @@ func (client *ReplicationMigrationItemsClient) pauseReplicationCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, pauseReplicationInput) + if err := runtime.MarshalAsJSON(req, pauseReplicationInput); err != nil { + return nil, err + } + return req, nil } // BeginResumeReplication - The operation to initiate resume replication of the item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -628,7 +651,8 @@ func (client *ReplicationMigrationItemsClient) BeginResumeReplication(ctx contex if err != nil { return nil, err } - return runtime.NewPoller[ReplicationMigrationItemsClientResumeReplicationResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationMigrationItemsClientResumeReplicationResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationMigrationItemsClientResumeReplicationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -637,20 +661,22 @@ func (client *ReplicationMigrationItemsClient) BeginResumeReplication(ctx contex // ResumeReplication - The operation to initiate resume replication of the item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationMigrationItemsClient) resumeReplication(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, resumeReplicationInput ResumeReplicationInput, options *ReplicationMigrationItemsClientBeginResumeReplicationOptions) (*http.Response, error) { + var err error req, err := client.resumeReplicationCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, resumeReplicationInput, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // resumeReplicationCreateRequest creates the ResumeReplication request. @@ -685,16 +711,19 @@ func (client *ReplicationMigrationItemsClient) resumeReplicationCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resumeReplicationInput) + if err := runtime.MarshalAsJSON(req, resumeReplicationInput); err != nil { + return nil, err + } + return req, nil } // BeginResync - The operation to resynchronize replication of an ASR migration item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -709,7 +738,8 @@ func (client *ReplicationMigrationItemsClient) BeginResync(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[ReplicationMigrationItemsClientResyncResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationMigrationItemsClientResyncResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationMigrationItemsClientResyncResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -718,20 +748,22 @@ func (client *ReplicationMigrationItemsClient) BeginResync(ctx context.Context, // Resync - The operation to resynchronize replication of an ASR migration item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationMigrationItemsClient) resync(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, input ResyncInput, options *ReplicationMigrationItemsClientBeginResyncOptions) (*http.Response, error) { + var err error req, err := client.resyncCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // resyncCreateRequest creates the Resync request. @@ -766,16 +798,19 @@ func (client *ReplicationMigrationItemsClient) resyncCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, input) + if err := runtime.MarshalAsJSON(req, input); err != nil { + return nil, err + } + return req, nil } // BeginTestMigrate - The operation to initiate test migration of the item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -790,7 +825,8 @@ func (client *ReplicationMigrationItemsClient) BeginTestMigrate(ctx context.Cont if err != nil { return nil, err } - return runtime.NewPoller[ReplicationMigrationItemsClientTestMigrateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationMigrationItemsClientTestMigrateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationMigrationItemsClientTestMigrateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -799,20 +835,22 @@ func (client *ReplicationMigrationItemsClient) BeginTestMigrate(ctx context.Cont // TestMigrate - The operation to initiate test migration of the item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationMigrationItemsClient) testMigrate(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput TestMigrateInput, options *ReplicationMigrationItemsClientBeginTestMigrateOptions) (*http.Response, error) { + var err error req, err := client.testMigrateCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, testMigrateInput, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // testMigrateCreateRequest creates the TestMigrate request. @@ -847,16 +885,19 @@ func (client *ReplicationMigrationItemsClient) testMigrateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, testMigrateInput) + if err := runtime.MarshalAsJSON(req, testMigrateInput); err != nil { + return nil, err + } + return req, nil } // BeginTestMigrateCleanup - The operation to initiate test migrate cleanup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -871,7 +912,8 @@ func (client *ReplicationMigrationItemsClient) BeginTestMigrateCleanup(ctx conte if err != nil { return nil, err } - return runtime.NewPoller[ReplicationMigrationItemsClientTestMigrateCleanupResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationMigrationItemsClientTestMigrateCleanupResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationMigrationItemsClientTestMigrateCleanupResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -880,20 +922,22 @@ func (client *ReplicationMigrationItemsClient) BeginTestMigrateCleanup(ctx conte // TestMigrateCleanup - The operation to initiate test migrate cleanup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationMigrationItemsClient) testMigrateCleanup(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput TestMigrateCleanupInput, options *ReplicationMigrationItemsClientBeginTestMigrateCleanupOptions) (*http.Response, error) { + var err error req, err := client.testMigrateCleanupCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // testMigrateCleanupCreateRequest creates the TestMigrateCleanup request. @@ -928,16 +972,19 @@ func (client *ReplicationMigrationItemsClient) testMigrateCleanupCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, testMigrateCleanupInput) + if err := runtime.MarshalAsJSON(req, testMigrateCleanupInput); err != nil { + return nil, err + } + return req, nil } // BeginUpdate - The operation to update the recovery settings of an ASR migration item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -952,7 +999,8 @@ func (client *ReplicationMigrationItemsClient) BeginUpdate(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[ReplicationMigrationItemsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationMigrationItemsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationMigrationItemsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -961,20 +1009,22 @@ func (client *ReplicationMigrationItemsClient) BeginUpdate(ctx context.Context, // Update - The operation to update the recovery settings of an ASR migration item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationMigrationItemsClient) update(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, input UpdateMigrationItemInput, options *ReplicationMigrationItemsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -1009,8 +1059,11 @@ func (client *ReplicationMigrationItemsClient) updateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, input) + if err := runtime.MarshalAsJSON(req, input); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationmigrationitems_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationmigrationitems_client_example_test.go deleted file mode 100644 index 7fa1f113639b..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationmigrationitems_client_example_test.go +++ /dev/null @@ -1,667 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_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/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_ListByReplicationProtectionContainers.json -func ExampleReplicationMigrationItemsClient_NewListByReplicationProtectionContainersPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationMigrationItemsClient().NewListByReplicationProtectionContainersPager("migrationvault", "resourcegroup1", "vmwarefabric1", "vmwareContainer1", &armrecoveryservicessiterecovery.ReplicationMigrationItemsClientListByReplicationProtectionContainersOptions{SkipToken: nil, - TakeToken: nil, - Filter: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MigrationItemCollection = armrecoveryservicessiterecovery.MigrationItemCollection{ - // Value: []*armrecoveryservicessiterecovery.MigrationItem{ - // { - // Name: to.Ptr("virtualmachine1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationMigrationItems"), - // ID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationFabrics/vmwarefabric1/replicationProtectionContainers/vmwareContainer1/replicationMigrationItems/virtualmachine1"), - // Properties: &armrecoveryservicessiterecovery.MigrationItemProperties{ - // AllowedOperations: []*armrecoveryservicessiterecovery.MigrationItemOperation{ - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationMigrate), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationDisableMigration), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationTestMigrate), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationTestMigrateCleanup)}, - // CurrentJob: &armrecoveryservicessiterecovery.CurrentJobDetails{ - // JobID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationJobs/None"), - // JobName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-26T06:37:50.8082715Z"); return t}()), - // }, - // MachineName: to.Ptr("vm-0520-2"), - // MigrationState: to.Ptr(armrecoveryservicessiterecovery.MigrationStateReplicating), - // MigrationStateDescription: to.Ptr("Ready to migrate"), - // PolicyFriendlyName: to.Ptr("vmwarepolicy1"), - // PolicyID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationPolicies/vmwarepolicy1"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.VMwareCbtMigrationDetails{ - // InstanceType: to.Ptr("VMwareCbt"), - // }, - // TestMigrateState: to.Ptr(armrecoveryservicessiterecovery.TestMigrationStateNone), - // TestMigrateStateDescription: to.Ptr("None"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Get.json -func ExampleReplicationMigrationItemsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationMigrationItemsClient().Get(ctx, "migrationvault", "resourcegroup1", "vmwarefabric1", "vmwareContainer1", "virtualmachine1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationItem = armrecoveryservicessiterecovery.MigrationItem{ - // Name: to.Ptr("virtualmachine1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationMigrationItems"), - // ID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationFabrics/vmwarefabric1/replicationProtectionContainers/vmwareContainer1/replicationMigrationItems/virtualmachine1"), - // Properties: &armrecoveryservicessiterecovery.MigrationItemProperties{ - // AllowedOperations: []*armrecoveryservicessiterecovery.MigrationItemOperation{ - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationMigrate), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationDisableMigration), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationTestMigrate), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationTestMigrateCleanup)}, - // CurrentJob: &armrecoveryservicessiterecovery.CurrentJobDetails{ - // JobID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationJobs/None"), - // JobName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-26T06:37:50.8082715Z"); return t}()), - // }, - // MachineName: to.Ptr("vm-0520-2"), - // MigrationState: to.Ptr(armrecoveryservicessiterecovery.MigrationStateReplicating), - // MigrationStateDescription: to.Ptr("Ready to migrate"), - // PolicyFriendlyName: to.Ptr("vmwarepolicy1"), - // PolicyID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationPolicies/vmwarepolicy1"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.VMwareCbtMigrationDetails{ - // InstanceType: to.Ptr("VMwareCbt"), - // }, - // TestMigrateState: to.Ptr(armrecoveryservicessiterecovery.TestMigrationStateNone), - // TestMigrateStateDescription: to.Ptr("None"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Create.json -func ExampleReplicationMigrationItemsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationMigrationItemsClient().BeginCreate(ctx, "migrationvault", "resourcegroup1", "vmwarefabric1", "vmwareContainer1", "virtualmachine1", armrecoveryservicessiterecovery.EnableMigrationInput{ - Properties: &armrecoveryservicessiterecovery.EnableMigrationInputProperties{ - PolicyID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationPolicies/vmwarepolicy1"), - ProviderSpecificDetails: &armrecoveryservicessiterecovery.VMwareCbtEnableMigrationInput{ - InstanceType: to.Ptr("VMwareCbt"), - DataMoverRunAsAccountID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.OffAzure/VMwareSites/vmwaresite1/runasaccounts/dataMoverRunAsAccount1"), - DisksToInclude: []*armrecoveryservicessiterecovery.VMwareCbtDiskInput{ - { - DiskID: to.Ptr("disk1"), - IsOSDisk: to.Ptr("true"), - LogStorageAccountID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.Storage/storageAccounts/logStorageAccount1"), - LogStorageAccountSasSecretName: to.Ptr("logStorageSas"), - }}, - SnapshotRunAsAccountID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.OffAzure/VMwareSites/vmwaresite1/runasaccounts/snapshotRunAsAccount1"), - TargetNetworkID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1"), - TargetResourceGroupID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1"), - VmwareMachineID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.OffAzure/VMwareSites/vmwaresite1/machines/virtualmachine1"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationItem = armrecoveryservicessiterecovery.MigrationItem{ - // Name: to.Ptr("virtualmachine1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationMigrationItems"), - // ID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationFabrics/vmwarefabric1/replicationProtectionContainers/vmwareContainer1/replicationMigrationItems/virtualmachine1"), - // Properties: &armrecoveryservicessiterecovery.MigrationItemProperties{ - // AllowedOperations: []*armrecoveryservicessiterecovery.MigrationItemOperation{ - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationMigrate), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationDisableMigration), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationTestMigrate), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationTestMigrateCleanup)}, - // CurrentJob: &armrecoveryservicessiterecovery.CurrentJobDetails{ - // JobID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationJobs/None"), - // JobName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-26T06:37:50.8082715Z"); return t}()), - // }, - // MachineName: to.Ptr("vm-0520-2"), - // MigrationState: to.Ptr(armrecoveryservicessiterecovery.MigrationStateReplicating), - // MigrationStateDescription: to.Ptr("Ready to migrate"), - // PolicyFriendlyName: to.Ptr("vmwarepolicy1"), - // PolicyID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationPolicies/vmwarepolicy1"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.VMwareCbtMigrationDetails{ - // InstanceType: to.Ptr("VMwareCbt"), - // }, - // TestMigrateState: to.Ptr(armrecoveryservicessiterecovery.TestMigrationStateNone), - // TestMigrateStateDescription: to.Ptr("None"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Delete.json -func ExampleReplicationMigrationItemsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationMigrationItemsClient().BeginDelete(ctx, "migrationvault", "resourcegroup1", "vmwarefabric1", "vmwareContainer1", "virtualmachine1", &armrecoveryservicessiterecovery.ReplicationMigrationItemsClientBeginDeleteOptions{DeleteOption: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Update.json -func ExampleReplicationMigrationItemsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationMigrationItemsClient().BeginUpdate(ctx, "migrationvault", "resourcegroup1", "vmwarefabric1", "vmwareContainer1", "virtualmachine1", armrecoveryservicessiterecovery.UpdateMigrationItemInput{ - Properties: &armrecoveryservicessiterecovery.UpdateMigrationItemInputProperties{ - ProviderSpecificDetails: &armrecoveryservicessiterecovery.VMwareCbtUpdateMigrationItemInput{ - InstanceType: to.Ptr("VMwareCbt"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationItem = armrecoveryservicessiterecovery.MigrationItem{ - // Name: to.Ptr("virtualmachine1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationMigrationItems"), - // ID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationFabrics/vmwarefabric1/replicationProtectionContainers/vmwareContainer1/replicationMigrationItems/virtualmachine1"), - // Properties: &armrecoveryservicessiterecovery.MigrationItemProperties{ - // AllowedOperations: []*armrecoveryservicessiterecovery.MigrationItemOperation{ - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationMigrate), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationDisableMigration), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationTestMigrate), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationTestMigrateCleanup)}, - // CurrentJob: &armrecoveryservicessiterecovery.CurrentJobDetails{ - // JobID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationJobs/None"), - // JobName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-26T06:37:50.8082715Z"); return t}()), - // }, - // MachineName: to.Ptr("vm-0520-2"), - // MigrationState: to.Ptr(armrecoveryservicessiterecovery.MigrationStateReplicating), - // MigrationStateDescription: to.Ptr("Ready to migrate"), - // PolicyFriendlyName: to.Ptr("vmwarepolicy1"), - // PolicyID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationPolicies/vmwarepolicy1"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.VMwareCbtMigrationDetails{ - // InstanceType: to.Ptr("VMwareCbt"), - // }, - // TestMigrateState: to.Ptr(armrecoveryservicessiterecovery.TestMigrationStateNone), - // TestMigrateStateDescription: to.Ptr("None"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Migrate.json -func ExampleReplicationMigrationItemsClient_BeginMigrate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationMigrationItemsClient().BeginMigrate(ctx, "migrationvault", "resourcegroup1", "vmwarefabric1", "vmwareContainer1", "virtualmachine1", armrecoveryservicessiterecovery.MigrateInput{ - Properties: &armrecoveryservicessiterecovery.MigrateInputProperties{ - ProviderSpecificDetails: &armrecoveryservicessiterecovery.VMwareCbtMigrateInput{ - InstanceType: to.Ptr("VMwareCbt"), - PerformShutdown: to.Ptr("true"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationItem = armrecoveryservicessiterecovery.MigrationItem{ - // Name: to.Ptr("virtualmachine1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationMigrationItems"), - // ID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationFabrics/vmwarefabric1/replicationProtectionContainers/vmwareContainer1/replicationMigrationItems/virtualmachine1"), - // Properties: &armrecoveryservicessiterecovery.MigrationItemProperties{ - // AllowedOperations: []*armrecoveryservicessiterecovery.MigrationItemOperation{ - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationMigrate), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationDisableMigration), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationTestMigrate), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationTestMigrateCleanup)}, - // CurrentJob: &armrecoveryservicessiterecovery.CurrentJobDetails{ - // JobID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationJobs/None"), - // JobName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-26T06:37:50.8082715Z"); return t}()), - // }, - // MachineName: to.Ptr("vm-0520-2"), - // MigrationState: to.Ptr(armrecoveryservicessiterecovery.MigrationStateReplicating), - // MigrationStateDescription: to.Ptr("Ready to migrate"), - // PolicyFriendlyName: to.Ptr("vmwarepolicy1"), - // PolicyID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationPolicies/vmwarepolicy1"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.VMwareCbtMigrationDetails{ - // InstanceType: to.Ptr("VMwareCbt"), - // }, - // TestMigrateState: to.Ptr(armrecoveryservicessiterecovery.TestMigrationStateNone), - // TestMigrateStateDescription: to.Ptr("None"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_PauseReplication.json -func ExampleReplicationMigrationItemsClient_BeginPauseReplication() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationMigrationItemsClient().BeginPauseReplication(ctx, "migrationvault", "resourcegroup1", "vmwarefabric1", "vmwareContainer1", "virtualmachine1", armrecoveryservicessiterecovery.PauseReplicationInput{ - Properties: &armrecoveryservicessiterecovery.PauseReplicationInputProperties{ - InstanceType: to.Ptr("VMwareCbt"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationItem = armrecoveryservicessiterecovery.MigrationItem{ - // Name: to.Ptr("virtualmachine1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationMigrationItems"), - // ID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationFabrics/vmwarefabric1/replicationProtectionContainers/vmwareContainer1/replicationMigrationItems/virtualmachine1"), - // Properties: &armrecoveryservicessiterecovery.MigrationItemProperties{ - // AllowedOperations: []*armrecoveryservicessiterecovery.MigrationItemOperation{ - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationDisableMigration)}, - // CurrentJob: &armrecoveryservicessiterecovery.CurrentJobDetails{ - // JobID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationJobs/None"), - // JobName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-26T06:37:50.8082715Z"); return t}()), - // }, - // MachineName: to.Ptr("vm-0520-2"), - // MigrationState: to.Ptr(armrecoveryservicessiterecovery.MigrationStateProtectionSuspended), - // MigrationStateDescription: to.Ptr("Paused"), - // PolicyFriendlyName: to.Ptr("vmwarepolicy1"), - // PolicyID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationPolicies/vmwarepolicy1"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.VMwareCbtMigrationDetails{ - // InstanceType: to.Ptr("VMwareCbt"), - // }, - // TestMigrateState: to.Ptr(armrecoveryservicessiterecovery.TestMigrationStateNone), - // TestMigrateStateDescription: to.Ptr("None"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_ResumeReplication.json -func ExampleReplicationMigrationItemsClient_BeginResumeReplication() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationMigrationItemsClient().BeginResumeReplication(ctx, "migrationvault", "resourcegroup1", "vmwarefabric1", "vmwareContainer1", "virtualmachine1", armrecoveryservicessiterecovery.ResumeReplicationInput{ - Properties: &armrecoveryservicessiterecovery.ResumeReplicationInputProperties{ - ProviderSpecificDetails: &armrecoveryservicessiterecovery.VMwareCbtResumeReplicationInput{ - InstanceType: to.Ptr("VMwareCbt"), - DeleteMigrationResources: to.Ptr("false"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationItem = armrecoveryservicessiterecovery.MigrationItem{ - // Name: to.Ptr("virtualmachine1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationMigrationItems"), - // ID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationFabrics/vmwarefabric1/replicationProtectionContainers/vmwareContainer1/replicationMigrationItems/virtualmachine1"), - // Properties: &armrecoveryservicessiterecovery.MigrationItemProperties{ - // AllowedOperations: []*armrecoveryservicessiterecovery.MigrationItemOperation{ - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationDisableMigration)}, - // CurrentJob: &armrecoveryservicessiterecovery.CurrentJobDetails{ - // JobID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationJobs/None"), - // JobName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-26T06:37:50.8082715Z"); return t}()), - // }, - // MachineName: to.Ptr("vm-0520-2"), - // MigrationState: to.Ptr(armrecoveryservicessiterecovery.MigrationStateResumeInitiated), - // MigrationStateDescription: to.Ptr("Resuming"), - // PolicyFriendlyName: to.Ptr("vmwarepolicy1"), - // PolicyID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationPolicies/vmwarepolicy1"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.VMwareCbtMigrationDetails{ - // InstanceType: to.Ptr("VMwareCbt"), - // }, - // TestMigrateState: to.Ptr(armrecoveryservicessiterecovery.TestMigrationStateNone), - // TestMigrateStateDescription: to.Ptr("None"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Resync.json -func ExampleReplicationMigrationItemsClient_BeginResync() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationMigrationItemsClient().BeginResync(ctx, "migrationvault", "resourcegroup1", "vmwarefabric1", "vmwareContainer1", "virtualmachine1", armrecoveryservicessiterecovery.ResyncInput{ - Properties: &armrecoveryservicessiterecovery.ResyncInputProperties{ - ProviderSpecificDetails: &armrecoveryservicessiterecovery.VMwareCbtResyncInput{ - InstanceType: to.Ptr("VMwareCbt"), - SkipCbtReset: to.Ptr("true"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationItem = armrecoveryservicessiterecovery.MigrationItem{ - // Name: to.Ptr("virtualmachine1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationMigrationItems"), - // ID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationFabrics/vmwarefabric1/replicationProtectionContainers/vmwareContainer1/replicationMigrationItems/virtualmachine1"), - // Properties: &armrecoveryservicessiterecovery.MigrationItemProperties{ - // AllowedOperations: []*armrecoveryservicessiterecovery.MigrationItemOperation{ - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationMigrate), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationDisableMigration), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationTestMigrate), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationTestMigrateCleanup)}, - // CurrentJob: &armrecoveryservicessiterecovery.CurrentJobDetails{ - // JobID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationJobs/None"), - // JobName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-26T06:37:50.8082715Z"); return t}()), - // }, - // MachineName: to.Ptr("vm-0520-2"), - // MigrationState: to.Ptr(armrecoveryservicessiterecovery.MigrationStateReplicating), - // MigrationStateDescription: to.Ptr("Ready to migrate"), - // PolicyFriendlyName: to.Ptr("vmwarepolicy1"), - // PolicyID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationPolicies/vmwarepolicy1"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.VMwareCbtMigrationDetails{ - // InstanceType: to.Ptr("VMwareCbt"), - // }, - // TestMigrateState: to.Ptr(armrecoveryservicessiterecovery.TestMigrationStateNone), - // TestMigrateStateDescription: to.Ptr("None"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_TestMigrate.json -func ExampleReplicationMigrationItemsClient_BeginTestMigrate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationMigrationItemsClient().BeginTestMigrate(ctx, "migrationvault", "resourcegroup1", "vmwarefabric1", "vmwareContainer1", "virtualmachine1", armrecoveryservicessiterecovery.TestMigrateInput{ - Properties: &armrecoveryservicessiterecovery.TestMigrateInputProperties{ - ProviderSpecificDetails: &armrecoveryservicessiterecovery.VMwareCbtTestMigrateInput{ - InstanceType: to.Ptr("VMwareCbt"), - NetworkID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1"), - RecoveryPointID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationFabrics/vmwarefabric1/replicationProtectionContainers/vmwareContainer1/replicationMigrationItems/virtualmachine1/migrationRecoveryPoints/9e737191-317e-43d0-8c83-e32ac3b34686"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationItem = armrecoveryservicessiterecovery.MigrationItem{ - // Name: to.Ptr("virtualmachine1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationMigrationItems"), - // ID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationFabrics/vmwarefabric1/replicationProtectionContainers/vmwareContainer1/replicationMigrationItems/virtualmachine1"), - // Properties: &armrecoveryservicessiterecovery.MigrationItemProperties{ - // AllowedOperations: []*armrecoveryservicessiterecovery.MigrationItemOperation{ - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationMigrate), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationDisableMigration), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationTestMigrate), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationTestMigrateCleanup)}, - // CurrentJob: &armrecoveryservicessiterecovery.CurrentJobDetails{ - // JobID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationJobs/None"), - // JobName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-26T06:37:50.8082715Z"); return t}()), - // }, - // MachineName: to.Ptr("vm-0520-2"), - // MigrationState: to.Ptr(armrecoveryservicessiterecovery.MigrationStateReplicating), - // MigrationStateDescription: to.Ptr("Ready to migrate"), - // PolicyFriendlyName: to.Ptr("vmwarepolicy1"), - // PolicyID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationPolicies/vmwarepolicy1"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.VMwareCbtMigrationDetails{ - // InstanceType: to.Ptr("VMwareCbt"), - // }, - // TestMigrateState: to.Ptr(armrecoveryservicessiterecovery.TestMigrationStateNone), - // TestMigrateStateDescription: to.Ptr("None"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_TestMigrateCleanup.json -func ExampleReplicationMigrationItemsClient_BeginTestMigrateCleanup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationMigrationItemsClient().BeginTestMigrateCleanup(ctx, "migrationvault", "resourcegroup1", "vmwarefabric1", "vmwareContainer1", "virtualmachine1", armrecoveryservicessiterecovery.TestMigrateCleanupInput{ - Properties: &armrecoveryservicessiterecovery.TestMigrateCleanupInputProperties{ - Comments: to.Ptr("Test Failover Cleanup"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrationItem = armrecoveryservicessiterecovery.MigrationItem{ - // Name: to.Ptr("virtualmachine1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationMigrationItems"), - // ID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationFabrics/vmwarefabric1/replicationProtectionContainers/vmwareContainer1/replicationMigrationItems/virtualmachine1"), - // Properties: &armrecoveryservicessiterecovery.MigrationItemProperties{ - // AllowedOperations: []*armrecoveryservicessiterecovery.MigrationItemOperation{ - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationMigrate), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationDisableMigration), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationTestMigrate), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationTestMigrateCleanup)}, - // CurrentJob: &armrecoveryservicessiterecovery.CurrentJobDetails{ - // JobID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationJobs/None"), - // JobName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-26T06:37:50.8082715Z"); return t}()), - // }, - // MachineName: to.Ptr("vm-0520-2"), - // MigrationState: to.Ptr(armrecoveryservicessiterecovery.MigrationStateReplicating), - // MigrationStateDescription: to.Ptr("Ready to migrate"), - // PolicyFriendlyName: to.Ptr("vmwarepolicy1"), - // PolicyID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationPolicies/vmwarepolicy1"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.VMwareCbtMigrationDetails{ - // InstanceType: to.Ptr("VMwareCbt"), - // }, - // TestMigrateState: to.Ptr(armrecoveryservicessiterecovery.TestMigrationStateNone), - // TestMigrateStateDescription: to.Ptr("None"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_List.json -func ExampleReplicationMigrationItemsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationMigrationItemsClient().NewListPager("migrationvault", "resourcegroup1", &armrecoveryservicessiterecovery.ReplicationMigrationItemsClientListOptions{SkipToken: nil, - TakeToken: nil, - Filter: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MigrationItemCollection = armrecoveryservicessiterecovery.MigrationItemCollection{ - // Value: []*armrecoveryservicessiterecovery.MigrationItem{ - // { - // Name: to.Ptr("virtualmachine1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationMigrationItems"), - // ID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationFabrics/vmwarefabric1/replicationProtectionContainers/vmwareContainer1/replicationMigrationItems/virtualmachine1"), - // Properties: &armrecoveryservicessiterecovery.MigrationItemProperties{ - // AllowedOperations: []*armrecoveryservicessiterecovery.MigrationItemOperation{ - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationMigrate), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationDisableMigration), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationTestMigrate), - // to.Ptr(armrecoveryservicessiterecovery.MigrationItemOperationTestMigrateCleanup)}, - // CurrentJob: &armrecoveryservicessiterecovery.CurrentJobDetails{ - // JobID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationJobs/None"), - // JobName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-26T06:37:50.8082715Z"); return t}()), - // }, - // MachineName: to.Ptr("vm-0520-2"), - // MigrationState: to.Ptr(armrecoveryservicessiterecovery.MigrationStateReplicating), - // MigrationStateDescription: to.Ptr("Ready to migrate"), - // PolicyFriendlyName: to.Ptr("vmwarepolicy1"), - // PolicyID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationPolicies/vmwarepolicy1"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.VMwareCbtMigrationDetails{ - // InstanceType: to.Ptr("VMwareCbt"), - // }, - // TestMigrateState: to.Ptr(armrecoveryservicessiterecovery.TestMigrationStateNone), - // TestMigrateStateDescription: to.Ptr("None"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationnetworkmappings_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationnetworkmappings_client.go index 85deee856544..c7bf7b586bc5 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationnetworkmappings_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationnetworkmappings_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -47,7 +46,7 @@ func NewReplicationNetworkMappingsClient(subscriptionID string, credential azcor // BeginCreate - The operation to create an ASR network mapping. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Primary fabric name. @@ -62,7 +61,8 @@ func (client *ReplicationNetworkMappingsClient) BeginCreate(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[ReplicationNetworkMappingsClientCreateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationNetworkMappingsClientCreateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationNetworkMappingsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ func (client *ReplicationNetworkMappingsClient) BeginCreate(ctx context.Context, // Create - The operation to create an ASR network mapping. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationNetworkMappingsClient) create(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, networkName string, networkMappingName string, input CreateNetworkMappingInput, options *ReplicationNetworkMappingsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, fabricName, networkName, networkMappingName, input, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -119,16 +121,19 @@ func (client *ReplicationNetworkMappingsClient) createCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, input) + if err := runtime.MarshalAsJSON(req, input); err != nil { + return nil, err + } + return req, nil } // BeginDelete - The operation to delete a network mapping. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Primary fabric name. @@ -142,7 +147,8 @@ func (client *ReplicationNetworkMappingsClient) BeginDelete(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[ReplicationNetworkMappingsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationNetworkMappingsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationNetworkMappingsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -151,20 +157,22 @@ func (client *ReplicationNetworkMappingsClient) BeginDelete(ctx context.Context, // Delete - The operation to delete a network mapping. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationNetworkMappingsClient) deleteOperation(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, networkName string, networkMappingName string, options *ReplicationNetworkMappingsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceName, resourceGroupName, fabricName, networkName, networkMappingName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -199,7 +207,7 @@ func (client *ReplicationNetworkMappingsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -207,7 +215,7 @@ func (client *ReplicationNetworkMappingsClient) deleteCreateRequest(ctx context. // Get - Gets the details of an ASR network mapping. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Primary fabric name. @@ -216,18 +224,21 @@ func (client *ReplicationNetworkMappingsClient) deleteCreateRequest(ctx context. // - options - ReplicationNetworkMappingsClientGetOptions contains the optional parameters for the ReplicationNetworkMappingsClient.Get // method. func (client *ReplicationNetworkMappingsClient) Get(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, networkName string, networkMappingName string, options *ReplicationNetworkMappingsClientGetOptions) (ReplicationNetworkMappingsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, networkName, networkMappingName, options) if err != nil { return ReplicationNetworkMappingsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationNetworkMappingsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationNetworkMappingsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationNetworkMappingsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -262,7 +273,7 @@ func (client *ReplicationNetworkMappingsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,7 +290,7 @@ func (client *ReplicationNetworkMappingsClient) getHandleResponse(resp *http.Res // NewListPager - Lists all ASR network mappings in the vault. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ReplicationNetworkMappingsClientListOptions contains the optional parameters for the ReplicationNetworkMappingsClient.NewListPager @@ -332,7 +343,7 @@ func (client *ReplicationNetworkMappingsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -349,7 +360,7 @@ func (client *ReplicationNetworkMappingsClient) listHandleResponse(resp *http.Re // NewListByReplicationNetworksPager - Lists all ASR network mappings for the specified network. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Primary fabric name. @@ -412,7 +423,7 @@ func (client *ReplicationNetworkMappingsClient) listByReplicationNetworksCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -430,7 +441,7 @@ func (client *ReplicationNetworkMappingsClient) listByReplicationNetworksHandleR // BeginUpdate - The operation to update an ASR network mapping. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Primary fabric name. @@ -445,7 +456,8 @@ func (client *ReplicationNetworkMappingsClient) BeginUpdate(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[ReplicationNetworkMappingsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationNetworkMappingsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationNetworkMappingsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -454,20 +466,22 @@ func (client *ReplicationNetworkMappingsClient) BeginUpdate(ctx context.Context, // Update - The operation to update an ASR network mapping. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationNetworkMappingsClient) update(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, networkName string, networkMappingName string, input UpdateNetworkMappingInput, options *ReplicationNetworkMappingsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceName, resourceGroupName, fabricName, networkName, networkMappingName, input, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -502,8 +516,11 @@ func (client *ReplicationNetworkMappingsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, input) + if err := runtime.MarshalAsJSON(req, input); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationnetworkmappings_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationnetworkmappings_client_example_test.go deleted file mode 100644 index 19c65e19953a..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationnetworkmappings_client_example_test.go +++ /dev/null @@ -1,270 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_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/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_ListByReplicationNetworks.json -func ExampleReplicationNetworkMappingsClient_NewListByReplicationNetworksPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationNetworkMappingsClient().NewListByReplicationNetworksPager("srce2avaultbvtaC27", "srcBvte2a14C27", "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac", "e2267b5c-2650-49bd-ab3f-d66aae694c06", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.NetworkMappingCollection = armrecoveryservicessiterecovery.NetworkMappingCollection{ - // Value: []*armrecoveryservicessiterecovery.NetworkMapping{ - // { - // Name: to.Ptr("corpe2amap"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationNetworks/replicationNetworkMappings"), - // ID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/srcBvte2a14C27/providers/Microsoft.RecoveryServices/vaults/srce2avaultbvtaC27/replicationFabrics/b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac/replicationNetworks/e2267b5c-2650-49bd-ab3f-d66aae694c06/replicationNetworkMappings/corpe2amap"), - // Properties: &armrecoveryservicessiterecovery.NetworkMappingProperties{ - // FabricSpecificSettings: &armrecoveryservicessiterecovery.VmmToAzureNetworkMappingSettings{ - // InstanceType: to.Ptr("VmmToAzure"), - // }, - // PrimaryFabricFriendlyName: to.Ptr("CP-B3L30108-01.ntdev.corp.microsoft.com"), - // PrimaryNetworkFriendlyName: to.Ptr("corp"), - // PrimaryNetworkID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/srcBvte2a14C27/providers/Microsoft.RecoveryServices/vaults/srce2avaultbvtaC27/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5/replicationNetworks/e2267b5c-2650-49bd-ab3f-d66aae694c06"), - // RecoveryFabricArmID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/srcBvte2a14C27/providers/Microsoft.RecoveryServices/vaults/srce2avaultbvtaC27/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryNetworkFriendlyName: to.Ptr("vnetavrai"), - // RecoveryNetworkID: to.Ptr("/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai"), - // State: to.Ptr("Paired"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Get.json -func ExampleReplicationNetworkMappingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationNetworkMappingsClient().Get(ctx, "srce2avaultbvtaC27", "srcBvte2a14C27", "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac", "e2267b5c-2650-49bd-ab3f-d66aae694c06", "corpe2amap", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NetworkMapping = armrecoveryservicessiterecovery.NetworkMapping{ - // Name: to.Ptr("corpe2amap"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationNetworks/replicationNetworkMappings"), - // ID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/srcBvte2a14C27/providers/Microsoft.RecoveryServices/vaults/srce2avaultbvtaC27/replicationFabrics/b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac/replicationNetworks/e2267b5c-2650-49bd-ab3f-d66aae694c06/replicationNetworkMappings/corpe2amap"), - // Properties: &armrecoveryservicessiterecovery.NetworkMappingProperties{ - // FabricSpecificSettings: &armrecoveryservicessiterecovery.VmmToAzureNetworkMappingSettings{ - // InstanceType: to.Ptr("VmmToAzure"), - // }, - // PrimaryFabricFriendlyName: to.Ptr("CP-B3L30108-01.ntdev.corp.microsoft.com"), - // PrimaryNetworkFriendlyName: to.Ptr("corp"), - // PrimaryNetworkID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/srcBvte2a14C27/providers/Microsoft.RecoveryServices/vaults/srce2avaultbvtaC27/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5/replicationNetworks/e2267b5c-2650-49bd-ab3f-d66aae694c06"), - // RecoveryFabricArmID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/srcBvte2a14C27/providers/Microsoft.RecoveryServices/vaults/srce2avaultbvtaC27/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryNetworkFriendlyName: to.Ptr("vnetavrai"), - // RecoveryNetworkID: to.Ptr("/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai"), - // State: to.Ptr("Paired"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Create.json -func ExampleReplicationNetworkMappingsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationNetworkMappingsClient().BeginCreate(ctx, "srce2avaultbvtaC27", "srcBvte2a14C27", "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac", "e2267b5c-2650-49bd-ab3f-d66aae694c06", "corpe2amap", armrecoveryservicessiterecovery.CreateNetworkMappingInput{ - Properties: &armrecoveryservicessiterecovery.CreateNetworkMappingInputProperties{ - FabricSpecificDetails: &armrecoveryservicessiterecovery.VmmToAzureCreateNetworkMappingInput{ - InstanceType: to.Ptr("VmmToAzure"), - }, - RecoveryFabricName: to.Ptr("Microsoft Azure"), - RecoveryNetworkID: to.Ptr("/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NetworkMapping = armrecoveryservicessiterecovery.NetworkMapping{ - // Name: to.Ptr("corpe2amap"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationNetworks/replicationNetworkMappings"), - // ID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/srcBvte2a14C27/providers/Microsoft.RecoveryServices/vaults/srce2avaultbvtaC27/replicationFabrics/b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac/replicationNetworks/e2267b5c-2650-49bd-ab3f-d66aae694c06/replicationNetworkMappings/corpe2amap"), - // Properties: &armrecoveryservicessiterecovery.NetworkMappingProperties{ - // FabricSpecificSettings: &armrecoveryservicessiterecovery.VmmToAzureNetworkMappingSettings{ - // InstanceType: to.Ptr("VmmToAzure"), - // }, - // PrimaryFabricFriendlyName: to.Ptr("CP-B3L30108-01.ntdev.corp.microsoft.com"), - // PrimaryNetworkFriendlyName: to.Ptr("corp"), - // PrimaryNetworkID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/srcBvte2a14C27/providers/Microsoft.RecoveryServices/vaults/srce2avaultbvtaC27/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5/replicationNetworks/e2267b5c-2650-49bd-ab3f-d66aae694c06"), - // RecoveryFabricArmID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/srcBvte2a14C27/providers/Microsoft.RecoveryServices/vaults/srce2avaultbvtaC27/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryNetworkFriendlyName: to.Ptr("vnetavrai"), - // RecoveryNetworkID: to.Ptr("/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai"), - // State: to.Ptr("Paired"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Delete.json -func ExampleReplicationNetworkMappingsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationNetworkMappingsClient().BeginDelete(ctx, "srce2avaultbvtaC27", "srcBvte2a14C27", "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac", "e2267b5c-2650-49bd-ab3f-d66aae694c06", "corpe2amap", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Update.json -func ExampleReplicationNetworkMappingsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationNetworkMappingsClient().BeginUpdate(ctx, "srce2avaultbvtaC27", "srcBvte2a14C27", "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac", "e2267b5c-2650-49bd-ab3f-d66aae694c06", "corpe2amap", armrecoveryservicessiterecovery.UpdateNetworkMappingInput{ - Properties: &armrecoveryservicessiterecovery.UpdateNetworkMappingInputProperties{ - FabricSpecificDetails: &armrecoveryservicessiterecovery.VmmToAzureUpdateNetworkMappingInput{ - InstanceType: to.Ptr("VmmToAzure"), - }, - RecoveryFabricName: to.Ptr("Microsoft Azure"), - RecoveryNetworkID: to.Ptr("/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NetworkMapping = armrecoveryservicessiterecovery.NetworkMapping{ - // Name: to.Ptr("corpe2amap"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationNetworks/replicationNetworkMappings"), - // ID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/srcBvte2a14C27/providers/Microsoft.RecoveryServices/vaults/srce2avaultbvtaC27/replicationFabrics/b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac/replicationNetworks/e2267b5c-2650-49bd-ab3f-d66aae694c06/replicationNetworkMappings/corpe2amap"), - // Properties: &armrecoveryservicessiterecovery.NetworkMappingProperties{ - // FabricSpecificSettings: &armrecoveryservicessiterecovery.VmmToAzureNetworkMappingSettings{ - // InstanceType: to.Ptr("VmmToAzure"), - // }, - // PrimaryFabricFriendlyName: to.Ptr("CP-B3L30108-01.ntdev.corp.microsoft.com"), - // PrimaryNetworkFriendlyName: to.Ptr("corp"), - // PrimaryNetworkID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/srcBvte2a14C27/providers/Microsoft.RecoveryServices/vaults/srce2avaultbvtaC27/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5/replicationNetworks/e2267b5c-2650-49bd-ab3f-d66aae694c06"), - // RecoveryFabricArmID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/srcBvte2a14C27/providers/Microsoft.RecoveryServices/vaults/srce2avaultbvtaC27/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryNetworkFriendlyName: to.Ptr("vnetavrai2"), - // RecoveryNetworkID: to.Ptr("/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai2"), - // State: to.Ptr("Paired"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_List.json -func ExampleReplicationNetworkMappingsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationNetworkMappingsClient().NewListPager("srce2avaultbvtaC27", "srcBvte2a14C27", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.NetworkMappingCollection = armrecoveryservicessiterecovery.NetworkMappingCollection{ - // Value: []*armrecoveryservicessiterecovery.NetworkMapping{ - // { - // Name: to.Ptr("corpe2amap"), - // Type: to.Ptr("Microsoft.RecoveryServicesBVTD2/vaults/replicationFabrics/replicationNetworks/replicationNetworkMappings"), - // ID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/srcBvte2a14C27/providers/Microsoft.RecoveryServicesBVTD2/vaults/srce2avaultbvtaC27/replicationFabrics/b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac/replicationNetworks/e2267b5c-2650-49bd-ab3f-d66aae694c06/replicationNetworkMappings/corpe2amap"), - // Properties: &armrecoveryservicessiterecovery.NetworkMappingProperties{ - // FabricSpecificSettings: &armrecoveryservicessiterecovery.VmmToAzureNetworkMappingSettings{ - // InstanceType: to.Ptr("VmmToAzure"), - // }, - // PrimaryFabricFriendlyName: to.Ptr("CP-B3L30108-01.ntdev.corp.microsoft.com"), - // PrimaryNetworkFriendlyName: to.Ptr("corp"), - // PrimaryNetworkID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/srcBvte2a14C27/providers/Microsoft.RecoveryServicesBVTD2/vaults/srce2avaultbvtaC27/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5/replicationNetworks/e2267b5c-2650-49bd-ab3f-d66aae694c06"), - // RecoveryFabricArmID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/srcBvte2a14C27/providers/Microsoft.RecoveryServicesBVTD2/vaults/srce2avaultbvtaC27/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryNetworkFriendlyName: to.Ptr("vnetavrai"), - // RecoveryNetworkID: to.Ptr("/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai"), - // State: to.Ptr("Paired"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationnetworks_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationnetworks_client.go index 8e617b340132..c5f7fdf61819 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationnetworks_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationnetworks_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -47,25 +46,28 @@ func NewReplicationNetworksClient(subscriptionID string, credential azcore.Token // Get - Gets the details of a network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Server Id. // - networkName - Primary network name. // - options - ReplicationNetworksClientGetOptions contains the optional parameters for the ReplicationNetworksClient.Get method. func (client *ReplicationNetworksClient) Get(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, networkName string, options *ReplicationNetworksClientGetOptions) (ReplicationNetworksClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, networkName, options) if err != nil { return ReplicationNetworksClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationNetworksClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationNetworksClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationNetworksClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -96,7 +98,7 @@ func (client *ReplicationNetworksClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -113,7 +115,7 @@ func (client *ReplicationNetworksClient) getHandleResponse(resp *http.Response) // NewListPager - Lists the networks available in a vault. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ReplicationNetworksClientListOptions contains the optional parameters for the ReplicationNetworksClient.NewListPager @@ -166,7 +168,7 @@ func (client *ReplicationNetworksClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -183,7 +185,7 @@ func (client *ReplicationNetworksClient) listHandleResponse(resp *http.Response) // NewListByReplicationFabricsPager - Lists the networks available for a fabric. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -241,7 +243,7 @@ func (client *ReplicationNetworksClient) listByReplicationFabricsCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationnetworks_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationnetworks_client_example_test.go deleted file mode 100644 index 2fe32d2ff6b3..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationnetworks_client_example_test.go +++ /dev/null @@ -1,178 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworks_ListByReplicationFabrics.json -func ExampleReplicationNetworksClient_NewListByReplicationFabricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationNetworksClient().NewListByReplicationFabricsPager("srce2avaultbvtaC27", "srcBvte2a14C27", "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.NetworkCollection = armrecoveryservicessiterecovery.NetworkCollection{ - // Value: []*armrecoveryservicessiterecovery.Network{ - // { - // Name: to.Ptr("93ce99d7-1219-4914-aa61-73fe5023988e"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationNetworks"), - // ID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/srcBvte2a14C27/providers/Microsoft.RecoveryServices/vaults/srce2avaultbvtaC27/replicationFabrics/b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac/replicationNetworks/93ce99d7-1219-4914-aa61-73fe5023988e"), - // Properties: &armrecoveryservicessiterecovery.NetworkProperties{ - // FabricType: to.Ptr("VMM"), - // FriendlyName: to.Ptr("VSwitch_VLan"), - // NetworkType: to.Ptr("NoIsolation"), - // Subnets: []*armrecoveryservicessiterecovery.Subnet{ - // }, - // }, - // }, - // { - // Name: to.Ptr("b83bf8fd-f304-48d7-82c9-5d74e6215c1b"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationNetworks"), - // ID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/srcBvte2a14C27/providers/Microsoft.RecoveryServices/vaults/srce2avaultbvtaC27/replicationFabrics/b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac/replicationNetworks/b83bf8fd-f304-48d7-82c9-5d74e6215c1b"), - // Properties: &armrecoveryservicessiterecovery.NetworkProperties{ - // FabricType: to.Ptr("VMM"), - // FriendlyName: to.Ptr("VSwitch_NoIso"), - // NetworkType: to.Ptr("NoIsolation"), - // Subnets: []*armrecoveryservicessiterecovery.Subnet{ - // }, - // }, - // }, - // { - // Name: to.Ptr("e2267b5c-2650-49bd-ab3f-d66aae694c06"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationNetworks"), - // ID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/srcBvte2a14C27/providers/Microsoft.RecoveryServices/vaults/srce2avaultbvtaC27/replicationFabrics/b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac/replicationNetworks/e2267b5c-2650-49bd-ab3f-d66aae694c06"), - // Properties: &armrecoveryservicessiterecovery.NetworkProperties{ - // FabricType: to.Ptr("VMM"), - // FriendlyName: to.Ptr("corp"), - // NetworkType: to.Ptr("NoIsolation"), - // Subnets: []*armrecoveryservicessiterecovery.Subnet{ - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworks_Get.json -func ExampleReplicationNetworksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationNetworksClient().Get(ctx, "srce2avaultbvtaC27", "srcBvte2a14C27", "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac", "93ce99d7-1219-4914-aa61-73fe5023988e", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Network = armrecoveryservicessiterecovery.Network{ - // Name: to.Ptr("93ce99d7-1219-4914-aa61-73fe5023988e"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationNetworks"), - // ID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/srcBvte2a14C27/providers/Microsoft.RecoveryServices/vaults/srce2avaultbvtaC27/replicationFabrics/b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac/replicationNetworks/93ce99d7-1219-4914-aa61-73fe5023988e"), - // Properties: &armrecoveryservicessiterecovery.NetworkProperties{ - // FabricType: to.Ptr("VMM"), - // FriendlyName: to.Ptr("VSwitch_VLan"), - // NetworkType: to.Ptr("NoIsolation"), - // Subnets: []*armrecoveryservicessiterecovery.Subnet{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworks_List.json -func ExampleReplicationNetworksClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationNetworksClient().NewListPager("srce2avaultbvtaC27", "srcBvte2a14C27", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.NetworkCollection = armrecoveryservicessiterecovery.NetworkCollection{ - // Value: []*armrecoveryservicessiterecovery.Network{ - // { - // Name: to.Ptr("93ce99d7-1219-4914-aa61-73fe5023988e"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationNetworks"), - // ID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/srcBvte2a14C27/providers/Microsoft.RecoveryServices/vaults/srce2avaultbvtaC27/replicationFabrics/b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac/replicationNetworks/93ce99d7-1219-4914-aa61-73fe5023988e"), - // Properties: &armrecoveryservicessiterecovery.NetworkProperties{ - // FabricType: to.Ptr("VMM"), - // FriendlyName: to.Ptr("VSwitch_VLan"), - // NetworkType: to.Ptr("NoIsolation"), - // Subnets: []*armrecoveryservicessiterecovery.Subnet{ - // }, - // }, - // }, - // { - // Name: to.Ptr("b83bf8fd-f304-48d7-82c9-5d74e6215c1b"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationNetworks"), - // ID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/srcBvte2a14C27/providers/Microsoft.RecoveryServices/vaults/srce2avaultbvtaC27/replicationFabrics/b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac/replicationNetworks/b83bf8fd-f304-48d7-82c9-5d74e6215c1b"), - // Properties: &armrecoveryservicessiterecovery.NetworkProperties{ - // FabricType: to.Ptr("VMM"), - // FriendlyName: to.Ptr("VSwitch_NoIso"), - // NetworkType: to.Ptr("NoIsolation"), - // Subnets: []*armrecoveryservicessiterecovery.Subnet{ - // }, - // }, - // }, - // { - // Name: to.Ptr("e2267b5c-2650-49bd-ab3f-d66aae694c06"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationNetworks"), - // ID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/srcBvte2a14C27/providers/Microsoft.RecoveryServices/vaults/srce2avaultbvtaC27/replicationFabrics/b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac/replicationNetworks/e2267b5c-2650-49bd-ab3f-d66aae694c06"), - // Properties: &armrecoveryservicessiterecovery.NetworkProperties{ - // FabricType: to.Ptr("VMM"), - // FriendlyName: to.Ptr("corp"), - // NetworkType: to.Ptr("NoIsolation"), - // Subnets: []*armrecoveryservicessiterecovery.Subnet{ - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationpolicies_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationpolicies_client.go index 10bc9a2c9280..41095e627593 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationpolicies_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationpolicies_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -47,7 +46,7 @@ func NewReplicationPoliciesClient(subscriptionID string, credential azcore.Token // BeginCreate - The operation to create a replication policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - policyName - Replication policy name. @@ -60,7 +59,8 @@ func (client *ReplicationPoliciesClient) BeginCreate(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller[ReplicationPoliciesClientCreateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationPoliciesClientCreateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationPoliciesClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -69,20 +69,22 @@ func (client *ReplicationPoliciesClient) BeginCreate(ctx context.Context, resour // Create - The operation to create a replication policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationPoliciesClient) create(ctx context.Context, resourceName string, resourceGroupName string, policyName string, input CreatePolicyInput, options *ReplicationPoliciesClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, policyName, input, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -109,16 +111,19 @@ func (client *ReplicationPoliciesClient) createCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, input) + if err := runtime.MarshalAsJSON(req, input); err != nil { + return nil, err + } + return req, nil } // BeginDelete - The operation to delete a replication policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - policyName - Replication policy name. @@ -130,7 +135,8 @@ func (client *ReplicationPoliciesClient) BeginDelete(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller[ReplicationPoliciesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationPoliciesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationPoliciesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -139,20 +145,22 @@ func (client *ReplicationPoliciesClient) BeginDelete(ctx context.Context, resour // Delete - The operation to delete a replication policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationPoliciesClient) deleteOperation(ctx context.Context, resourceName string, resourceGroupName string, policyName string, options *ReplicationPoliciesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceName, resourceGroupName, policyName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -179,7 +187,7 @@ func (client *ReplicationPoliciesClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -187,24 +195,27 @@ func (client *ReplicationPoliciesClient) deleteCreateRequest(ctx context.Context // Get - Gets the details of a replication policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - policyName - Replication policy name. // - options - ReplicationPoliciesClientGetOptions contains the optional parameters for the ReplicationPoliciesClient.Get method. func (client *ReplicationPoliciesClient) Get(ctx context.Context, resourceName string, resourceGroupName string, policyName string, options *ReplicationPoliciesClientGetOptions) (ReplicationPoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, policyName, options) if err != nil { return ReplicationPoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationPoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationPoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -231,7 +242,7 @@ func (client *ReplicationPoliciesClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -248,7 +259,7 @@ func (client *ReplicationPoliciesClient) getHandleResponse(resp *http.Response) // NewListPager - Lists the replication policies for a vault. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ReplicationPoliciesClientListOptions contains the optional parameters for the ReplicationPoliciesClient.NewListPager @@ -301,7 +312,7 @@ func (client *ReplicationPoliciesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -319,7 +330,7 @@ func (client *ReplicationPoliciesClient) listHandleResponse(resp *http.Response) // BeginUpdate - The operation to update a replication policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - policyName - Policy Id. @@ -332,7 +343,8 @@ func (client *ReplicationPoliciesClient) BeginUpdate(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller[ReplicationPoliciesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationPoliciesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationPoliciesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -341,20 +353,22 @@ func (client *ReplicationPoliciesClient) BeginUpdate(ctx context.Context, resour // Update - The operation to update a replication policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationPoliciesClient) update(ctx context.Context, resourceName string, resourceGroupName string, policyName string, input UpdatePolicyInput, options *ReplicationPoliciesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceName, resourceGroupName, policyName, input, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -381,8 +395,11 @@ func (client *ReplicationPoliciesClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, input) + if err := runtime.MarshalAsJSON(req, input); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationpolicies_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationpolicies_client_example_test.go deleted file mode 100644 index 5e5370178b8c..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationpolicies_client_example_test.go +++ /dev/null @@ -1,192 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_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/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_List.json -func ExampleReplicationPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationPoliciesClient().NewListPager("vault1", "resourceGroupPS1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PolicyCollection = armrecoveryservicessiterecovery.PolicyCollection{ - // Value: []*armrecoveryservicessiterecovery.Policy{ - // { - // Name: to.Ptr("protectionprofile1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationPolicies"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - // Properties: &armrecoveryservicessiterecovery.PolicyProperties{ - // FriendlyName: to.Ptr("protectionprofile1"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzurePolicyDetails{ - // InstanceType: to.Ptr("HyperVReplicaAzure"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Get.json -func ExampleReplicationPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationPoliciesClient().Get(ctx, "vault1", "resourceGroupPS1", "protectionprofile1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Policy = armrecoveryservicessiterecovery.Policy{ - // Name: to.Ptr("protectionprofile1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationPolicies"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - // Properties: &armrecoveryservicessiterecovery.PolicyProperties{ - // FriendlyName: to.Ptr("protectionprofile1"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzurePolicyDetails{ - // InstanceType: to.Ptr("HyperVReplicaAzure"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Create.json -func ExampleReplicationPoliciesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationPoliciesClient().BeginCreate(ctx, "vault1", "resourceGroupPS1", "protectionprofile1", armrecoveryservicessiterecovery.CreatePolicyInput{ - Properties: &armrecoveryservicessiterecovery.CreatePolicyInputProperties{ - ProviderSpecificInput: &armrecoveryservicessiterecovery.HyperVReplicaAzurePolicyInput{ - InstanceType: to.Ptr("HyperVReplicaAzure"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Policy = armrecoveryservicessiterecovery.Policy{ - // Name: to.Ptr("protectionprofile1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationPolicies"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - // Properties: &armrecoveryservicessiterecovery.PolicyProperties{ - // FriendlyName: to.Ptr("protectionprofile1"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzurePolicyDetails{ - // InstanceType: to.Ptr("HyperVReplicaAzure"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Delete.json -func ExampleReplicationPoliciesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationPoliciesClient().BeginDelete(ctx, "vault1", "resourceGroupPS1", "protectionprofile1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Update.json -func ExampleReplicationPoliciesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationPoliciesClient().BeginUpdate(ctx, "vault1", "resourceGroupPS1", "protectionprofile1", armrecoveryservicessiterecovery.UpdatePolicyInput{ - Properties: &armrecoveryservicessiterecovery.UpdatePolicyInputProperties{ - ReplicationProviderSettings: &armrecoveryservicessiterecovery.HyperVReplicaAzurePolicyInput{ - InstanceType: to.Ptr("HyperVReplicaAzure"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Policy = armrecoveryservicessiterecovery.Policy{ - // Name: to.Ptr("protectionprofile1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationPolicies"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - // Properties: &armrecoveryservicessiterecovery.PolicyProperties{ - // FriendlyName: to.Ptr("protectionprofile1"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzurePolicyDetails{ - // InstanceType: to.Ptr("HyperVReplicaAzure"), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectableitems_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectableitems_client.go index d693206b4bc9..16f58a1be0dd 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectableitems_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectableitems_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -47,7 +46,7 @@ func NewReplicationProtectableItemsClient(subscriptionID string, credential azco // Get - The operation to get the details of a protectable item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -56,18 +55,21 @@ func NewReplicationProtectableItemsClient(subscriptionID string, credential azco // - options - ReplicationProtectableItemsClientGetOptions contains the optional parameters for the ReplicationProtectableItemsClient.Get // method. func (client *ReplicationProtectableItemsClient) Get(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, protectableItemName string, options *ReplicationProtectableItemsClientGetOptions) (ReplicationProtectableItemsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, protectableItemName, options) if err != nil { return ReplicationProtectableItemsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationProtectableItemsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationProtectableItemsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationProtectableItemsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -102,7 +104,7 @@ func (client *ReplicationProtectableItemsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -119,7 +121,7 @@ func (client *ReplicationProtectableItemsClient) getHandleResponse(resp *http.Re // NewListByReplicationProtectionContainersPager - Lists the protectable items in a protection container. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -182,7 +184,7 @@ func (client *ReplicationProtectableItemsClient) listByReplicationProtectionCont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectableitems_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectableitems_client_example_test.go deleted file mode 100644 index 33c49baefbad..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectableitems_client_example_test.go +++ /dev/null @@ -1,120 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectableItems_ListByReplicationProtectionContainers.json -func ExampleReplicationProtectableItemsClient_NewListByReplicationProtectionContainersPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationProtectableItemsClient().NewListByReplicationProtectionContainersPager("vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", &armrecoveryservicessiterecovery.ReplicationProtectableItemsClientListByReplicationProtectionContainersOptions{Filter: nil, - Take: nil, - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ProtectableItemCollection = armrecoveryservicessiterecovery.ProtectableItemCollection{ - // Value: []*armrecoveryservicessiterecovery.ProtectableItem{ - // { - // Name: to.Ptr("c0c14913-3d7a-48ea-9531-cc99e0e686e6"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectableItems"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectableItems/c0c14913-3d7a-48ea-9531-cc99e0e686e6"), - // Properties: &armrecoveryservicessiterecovery.ProtectableItemProperties{ - // CustomDetails: &armrecoveryservicessiterecovery.ReplicationGroupDetails{ - // InstanceType: to.Ptr("ReplicationGroupDetails"), - // }, - // FriendlyName: to.Ptr("vm2"), - // ProtectionReadinessErrors: []*string{ - // }, - // ProtectionStatus: to.Ptr("Unprotected"), - // RecoveryServicesProviderID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/241641e6-ee7b-4ee4-8141-821fadda43fa"), - // SupportedReplicationProviders: []*string{ - // to.Ptr("HyperVReplicaAzure")}, - // }, - // }, - // { - // Name: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectableItems"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectableItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // Properties: &armrecoveryservicessiterecovery.ProtectableItemProperties{ - // CustomDetails: &armrecoveryservicessiterecovery.ReplicationGroupDetails{ - // InstanceType: to.Ptr("ReplicationGroupDetails"), - // }, - // FriendlyName: to.Ptr("vm1"), - // ProtectionReadinessErrors: []*string{ - // }, - // ProtectionStatus: to.Ptr("Unprotected"), - // RecoveryServicesProviderID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/241641e6-ee7b-4ee4-8141-821fadda43fa"), - // SupportedReplicationProviders: []*string{ - // to.Ptr("HyperVReplicaAzure")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectableItems_Get.json -func ExampleReplicationProtectableItemsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationProtectableItemsClient().Get(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "c0c14913-3d7a-48ea-9531-cc99e0e686e6", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectableItem = armrecoveryservicessiterecovery.ProtectableItem{ - // Name: to.Ptr("c0c14913-3d7a-48ea-9531-cc99e0e686e6"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectableItems"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectableItems/c0c14913-3d7a-48ea-9531-cc99e0e686e6"), - // Properties: &armrecoveryservicessiterecovery.ProtectableItemProperties{ - // CustomDetails: &armrecoveryservicessiterecovery.ReplicationGroupDetails{ - // InstanceType: to.Ptr("ReplicationGroupDetails"), - // }, - // FriendlyName: to.Ptr("vm2"), - // ProtectionReadinessErrors: []*string{ - // }, - // ProtectionStatus: to.Ptr("Unprotected"), - // RecoveryServicesProviderID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/241641e6-ee7b-4ee4-8141-821fadda43fa"), - // SupportedReplicationProviders: []*string{ - // to.Ptr("HyperVReplicaAzure")}, - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotecteditems_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotecteditems_client.go index c04fabaa2efb..8bebaa0d06a8 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotecteditems_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotecteditems_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -47,7 +46,7 @@ func NewReplicationProtectedItemsClient(subscriptionID string, credential azcore // BeginAddDisks - Operation to add disks(s) to the replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Unique fabric name. @@ -62,7 +61,8 @@ func (client *ReplicationProtectedItemsClient) BeginAddDisks(ctx context.Context if err != nil { return nil, err } - return runtime.NewPoller[ReplicationProtectedItemsClientAddDisksResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationProtectedItemsClientAddDisksResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectedItemsClientAddDisksResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ func (client *ReplicationProtectedItemsClient) BeginAddDisks(ctx context.Context // AddDisks - Operation to add disks(s) to the replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectedItemsClient) addDisks(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput AddDisksInput, options *ReplicationProtectedItemsClientBeginAddDisksOptions) (*http.Response, error) { + var err error req, err := client.addDisksCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, addDisksInput, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // addDisksCreateRequest creates the AddDisks request. @@ -119,16 +121,19 @@ func (client *ReplicationProtectedItemsClient) addDisksCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, addDisksInput) + if err := runtime.MarshalAsJSON(req, addDisksInput); err != nil { + return nil, err + } + return req, nil } // BeginApplyRecoveryPoint - The operation to change the recovery point of a failed over replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - The ARM fabric name. @@ -143,7 +148,8 @@ func (client *ReplicationProtectedItemsClient) BeginApplyRecoveryPoint(ctx conte if err != nil { return nil, err } - return runtime.NewPoller[ReplicationProtectedItemsClientApplyRecoveryPointResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationProtectedItemsClientApplyRecoveryPointResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectedItemsClientApplyRecoveryPointResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -152,20 +158,22 @@ func (client *ReplicationProtectedItemsClient) BeginApplyRecoveryPoint(ctx conte // ApplyRecoveryPoint - The operation to change the recovery point of a failed over replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectedItemsClient) applyRecoveryPoint(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput ApplyRecoveryPointInput, options *ReplicationProtectedItemsClientBeginApplyRecoveryPointOptions) (*http.Response, error) { + var err error req, err := client.applyRecoveryPointCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, applyRecoveryPointInput, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // applyRecoveryPointCreateRequest creates the ApplyRecoveryPoint request. @@ -200,16 +208,19 @@ func (client *ReplicationProtectedItemsClient) applyRecoveryPointCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, applyRecoveryPointInput) + if err := runtime.MarshalAsJSON(req, applyRecoveryPointInput); err != nil { + return nil, err + } + return req, nil } // BeginCreate - The operation to create an ASR replication protected item (Enable replication). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Name of the fabric. @@ -224,7 +235,8 @@ func (client *ReplicationProtectedItemsClient) BeginCreate(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[ReplicationProtectedItemsClientCreateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationProtectedItemsClientCreateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectedItemsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -233,20 +245,22 @@ func (client *ReplicationProtectedItemsClient) BeginCreate(ctx context.Context, // Create - The operation to create an ASR replication protected item (Enable replication). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectedItemsClient) create(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input EnableProtectionInput, options *ReplicationProtectedItemsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, input, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -281,16 +295,19 @@ func (client *ReplicationProtectedItemsClient) createCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, input) + if err := runtime.MarshalAsJSON(req, input); err != nil { + return nil, err + } + return req, nil } // BeginDelete - The operation to disable replication on a replication protected item. This will also remove the item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -305,7 +322,8 @@ func (client *ReplicationProtectedItemsClient) BeginDelete(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[ReplicationProtectedItemsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationProtectedItemsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectedItemsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -314,20 +332,22 @@ func (client *ReplicationProtectedItemsClient) BeginDelete(ctx context.Context, // Delete - The operation to disable replication on a replication protected item. This will also remove the item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectedItemsClient) deleteOperation(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput DisableProtectionInput, options *ReplicationProtectedItemsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, disableProtectionInput, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -362,15 +382,18 @@ func (client *ReplicationProtectedItemsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() - return req, runtime.MarshalAsJSON(req, disableProtectionInput) + if err := runtime.MarshalAsJSON(req, disableProtectionInput); err != nil { + return nil, err + } + return req, nil } // BeginFailoverCancel - Operation to cancel the failover of the replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Unique fabric name. @@ -384,7 +407,8 @@ func (client *ReplicationProtectedItemsClient) BeginFailoverCancel(ctx context.C if err != nil { return nil, err } - return runtime.NewPoller[ReplicationProtectedItemsClientFailoverCancelResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationProtectedItemsClientFailoverCancelResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectedItemsClientFailoverCancelResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -393,20 +417,22 @@ func (client *ReplicationProtectedItemsClient) BeginFailoverCancel(ctx context.C // FailoverCancel - Operation to cancel the failover of the replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectedItemsClient) failoverCancel(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginFailoverCancelOptions) (*http.Response, error) { + var err error req, err := client.failoverCancelCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // failoverCancelCreateRequest creates the FailoverCancel request. @@ -441,7 +467,7 @@ func (client *ReplicationProtectedItemsClient) failoverCancelCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -450,7 +476,7 @@ func (client *ReplicationProtectedItemsClient) failoverCancelCreateRequest(ctx c // BeginFailoverCommit - Operation to commit the failover of the replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Unique fabric name. @@ -464,7 +490,8 @@ func (client *ReplicationProtectedItemsClient) BeginFailoverCommit(ctx context.C if err != nil { return nil, err } - return runtime.NewPoller[ReplicationProtectedItemsClientFailoverCommitResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationProtectedItemsClientFailoverCommitResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectedItemsClientFailoverCommitResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -473,20 +500,22 @@ func (client *ReplicationProtectedItemsClient) BeginFailoverCommit(ctx context.C // FailoverCommit - Operation to commit the failover of the replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectedItemsClient) failoverCommit(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginFailoverCommitOptions) (*http.Response, error) { + var err error req, err := client.failoverCommitCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // failoverCommitCreateRequest creates the FailoverCommit request. @@ -521,7 +550,7 @@ func (client *ReplicationProtectedItemsClient) failoverCommitCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -530,7 +559,7 @@ func (client *ReplicationProtectedItemsClient) failoverCommitCreateRequest(ctx c // Get - Gets the details of an ASR replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric unique name. @@ -539,18 +568,21 @@ func (client *ReplicationProtectedItemsClient) failoverCommitCreateRequest(ctx c // - options - ReplicationProtectedItemsClientGetOptions contains the optional parameters for the ReplicationProtectedItemsClient.Get // method. func (client *ReplicationProtectedItemsClient) Get(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientGetOptions) (ReplicationProtectedItemsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, options) if err != nil { return ReplicationProtectedItemsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationProtectedItemsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationProtectedItemsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationProtectedItemsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -585,7 +617,7 @@ func (client *ReplicationProtectedItemsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -602,7 +634,7 @@ func (client *ReplicationProtectedItemsClient) getHandleResponse(resp *http.Resp // NewListPager - Gets the list of ASR replication protected items in the vault. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ReplicationProtectedItemsClientListOptions contains the optional parameters for the ReplicationProtectedItemsClient.NewListPager @@ -655,7 +687,7 @@ func (client *ReplicationProtectedItemsClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") if options != nil && options.SkipToken != nil { reqQP.Set("skipToken", *options.SkipToken) } @@ -678,7 +710,7 @@ func (client *ReplicationProtectedItemsClient) listHandleResponse(resp *http.Res // NewListByReplicationProtectionContainersPager - Gets the list of ASR replication protected items in the protection container. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -741,7 +773,7 @@ func (client *ReplicationProtectedItemsClient) listByReplicationProtectionContai return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -759,7 +791,7 @@ func (client *ReplicationProtectedItemsClient) listByReplicationProtectionContai // BeginPlannedFailover - Operation to initiate a planned failover of the replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Unique fabric name. @@ -774,7 +806,8 @@ func (client *ReplicationProtectedItemsClient) BeginPlannedFailover(ctx context. if err != nil { return nil, err } - return runtime.NewPoller[ReplicationProtectedItemsClientPlannedFailoverResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationProtectedItemsClientPlannedFailoverResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectedItemsClientPlannedFailoverResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -783,20 +816,22 @@ func (client *ReplicationProtectedItemsClient) BeginPlannedFailover(ctx context. // PlannedFailover - Operation to initiate a planned failover of the replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectedItemsClient) plannedFailover(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput PlannedFailoverInput, options *ReplicationProtectedItemsClientBeginPlannedFailoverOptions) (*http.Response, error) { + var err error req, err := client.plannedFailoverCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // plannedFailoverCreateRequest creates the PlannedFailover request. @@ -831,10 +866,13 @@ func (client *ReplicationProtectedItemsClient) plannedFailoverCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, failoverInput) + if err := runtime.MarshalAsJSON(req, failoverInput); err != nil { + return nil, err + } + return req, nil } // BeginPurge - The operation to delete or purge a replication protected item. This operation will force delete the replication @@ -842,7 +880,7 @@ func (client *ReplicationProtectedItemsClient) plannedFailoverCreateRequest(ctx // clean disable replication for the item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -856,7 +894,8 @@ func (client *ReplicationProtectedItemsClient) BeginPurge(ctx context.Context, r if err != nil { return nil, err } - return runtime.NewPoller[ReplicationProtectedItemsClientPurgeResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationProtectedItemsClientPurgeResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectedItemsClientPurgeResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -867,20 +906,22 @@ func (client *ReplicationProtectedItemsClient) BeginPurge(ctx context.Context, r // clean disable replication for the item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectedItemsClient) purge(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginPurgeOptions) (*http.Response, error) { + var err error req, err := client.purgeCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // purgeCreateRequest creates the Purge request. @@ -915,7 +956,7 @@ func (client *ReplicationProtectedItemsClient) purgeCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -923,7 +964,7 @@ func (client *ReplicationProtectedItemsClient) purgeCreateRequest(ctx context.Co // BeginRemoveDisks - Operation to remove disk(s) from the replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Unique fabric name. @@ -938,7 +979,8 @@ func (client *ReplicationProtectedItemsClient) BeginRemoveDisks(ctx context.Cont if err != nil { return nil, err } - return runtime.NewPoller[ReplicationProtectedItemsClientRemoveDisksResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationProtectedItemsClientRemoveDisksResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectedItemsClientRemoveDisksResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -947,20 +989,22 @@ func (client *ReplicationProtectedItemsClient) BeginRemoveDisks(ctx context.Cont // RemoveDisks - Operation to remove disk(s) from the replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectedItemsClient) removeDisks(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput RemoveDisksInput, options *ReplicationProtectedItemsClientBeginRemoveDisksOptions) (*http.Response, error) { + var err error req, err := client.removeDisksCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, removeDisksInput, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // removeDisksCreateRequest creates the RemoveDisks request. @@ -995,17 +1039,20 @@ func (client *ReplicationProtectedItemsClient) removeDisksCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, removeDisksInput) + if err := runtime.MarshalAsJSON(req, removeDisksInput); err != nil { + return nil, err + } + return req, nil } // BeginRepairReplication - The operation to start resynchronize/repair replication for a replication protected item requiring // resynchronization. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - The name of the fabric. @@ -1019,7 +1066,8 @@ func (client *ReplicationProtectedItemsClient) BeginRepairReplication(ctx contex if err != nil { return nil, err } - return runtime.NewPoller[ReplicationProtectedItemsClientRepairReplicationResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationProtectedItemsClientRepairReplicationResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectedItemsClientRepairReplicationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -1029,20 +1077,22 @@ func (client *ReplicationProtectedItemsClient) BeginRepairReplication(ctx contex // resynchronization. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectedItemsClient) repairReplication(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginRepairReplicationOptions) (*http.Response, error) { + var err error req, err := client.repairReplicationCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // repairReplicationCreateRequest creates the RepairReplication request. @@ -1077,7 +1127,7 @@ func (client *ReplicationProtectedItemsClient) repairReplicationCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1086,7 +1136,7 @@ func (client *ReplicationProtectedItemsClient) repairReplicationCreateRequest(ct // BeginReprotect - Operation to reprotect or reverse replicate a failed over replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Unique fabric name. @@ -1101,7 +1151,8 @@ func (client *ReplicationProtectedItemsClient) BeginReprotect(ctx context.Contex if err != nil { return nil, err } - return runtime.NewPoller[ReplicationProtectedItemsClientReprotectResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationProtectedItemsClientReprotectResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectedItemsClientReprotectResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -1110,20 +1161,22 @@ func (client *ReplicationProtectedItemsClient) BeginReprotect(ctx context.Contex // Reprotect - Operation to reprotect or reverse replicate a failed over replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectedItemsClient) reprotect(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput ReverseReplicationInput, options *ReplicationProtectedItemsClientBeginReprotectOptions) (*http.Response, error) { + var err error req, err := client.reprotectCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, reprotectInput, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // reprotectCreateRequest creates the Reprotect request. @@ -1158,16 +1211,19 @@ func (client *ReplicationProtectedItemsClient) reprotectCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, reprotectInput) + if err := runtime.MarshalAsJSON(req, reprotectInput); err != nil { + return nil, err + } + return req, nil } // BeginResolveHealthErrors - Operation to resolve health issues of the replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Unique fabric name. @@ -1182,7 +1238,8 @@ func (client *ReplicationProtectedItemsClient) BeginResolveHealthErrors(ctx cont if err != nil { return nil, err } - return runtime.NewPoller[ReplicationProtectedItemsClientResolveHealthErrorsResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationProtectedItemsClientResolveHealthErrorsResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectedItemsClientResolveHealthErrorsResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -1191,20 +1248,22 @@ func (client *ReplicationProtectedItemsClient) BeginResolveHealthErrors(ctx cont // ResolveHealthErrors - Operation to resolve health issues of the replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectedItemsClient) resolveHealthErrors(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput ResolveHealthInput, options *ReplicationProtectedItemsClientBeginResolveHealthErrorsOptions) (*http.Response, error) { + var err error req, err := client.resolveHealthErrorsCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, resolveHealthInput, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // resolveHealthErrorsCreateRequest creates the ResolveHealthErrors request. @@ -1239,16 +1298,19 @@ func (client *ReplicationProtectedItemsClient) resolveHealthErrorsCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resolveHealthInput) + if err := runtime.MarshalAsJSON(req, resolveHealthInput); err != nil { + return nil, err + } + return req, nil } // BeginSwitchProvider - Operation to initiate a switch provider of the replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Unique fabric name. @@ -1263,9 +1325,10 @@ func (client *ReplicationProtectedItemsClient) BeginSwitchProvider(ctx context.C if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReplicationProtectedItemsClientSwitchProviderResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReplicationProtectedItemsClientSwitchProviderResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectedItemsClientSwitchProviderResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -1274,20 +1337,22 @@ func (client *ReplicationProtectedItemsClient) BeginSwitchProvider(ctx context.C // SwitchProvider - Operation to initiate a switch provider of the replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectedItemsClient) switchProvider(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, switchProviderInput SwitchProviderInput, options *ReplicationProtectedItemsClientBeginSwitchProviderOptions) (*http.Response, error) { + var err error req, err := client.switchProviderCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, switchProviderInput, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // switchProviderCreateRequest creates the SwitchProvider request. @@ -1322,16 +1387,19 @@ func (client *ReplicationProtectedItemsClient) switchProviderCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, switchProviderInput) + if err := runtime.MarshalAsJSON(req, switchProviderInput); err != nil { + return nil, err + } + return req, nil } // BeginTestFailover - Operation to perform a test failover of the replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Unique fabric name. @@ -1346,7 +1414,8 @@ func (client *ReplicationProtectedItemsClient) BeginTestFailover(ctx context.Con if err != nil { return nil, err } - return runtime.NewPoller[ReplicationProtectedItemsClientTestFailoverResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationProtectedItemsClientTestFailoverResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectedItemsClientTestFailoverResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -1355,20 +1424,22 @@ func (client *ReplicationProtectedItemsClient) BeginTestFailover(ctx context.Con // TestFailover - Operation to perform a test failover of the replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectedItemsClient) testFailover(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput TestFailoverInput, options *ReplicationProtectedItemsClientBeginTestFailoverOptions) (*http.Response, error) { + var err error req, err := client.testFailoverCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, testfailoverInput, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // testFailoverCreateRequest creates the TestFailover request. @@ -1403,16 +1474,19 @@ func (client *ReplicationProtectedItemsClient) testFailoverCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, testfailoverInput) + if err := runtime.MarshalAsJSON(req, testfailoverInput); err != nil { + return nil, err + } + return req, nil } // BeginTestFailoverCleanup - Operation to clean up the test failover of a replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Unique fabric name. @@ -1427,7 +1501,8 @@ func (client *ReplicationProtectedItemsClient) BeginTestFailoverCleanup(ctx cont if err != nil { return nil, err } - return runtime.NewPoller[ReplicationProtectedItemsClientTestFailoverCleanupResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationProtectedItemsClientTestFailoverCleanupResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectedItemsClientTestFailoverCleanupResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -1436,20 +1511,22 @@ func (client *ReplicationProtectedItemsClient) BeginTestFailoverCleanup(ctx cont // TestFailoverCleanup - Operation to clean up the test failover of a replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectedItemsClient) testFailoverCleanup(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput TestFailoverCleanupInput, options *ReplicationProtectedItemsClientBeginTestFailoverCleanupOptions) (*http.Response, error) { + var err error req, err := client.testFailoverCleanupCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, cleanupInput, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // testFailoverCleanupCreateRequest creates the TestFailoverCleanup request. @@ -1484,16 +1561,19 @@ func (client *ReplicationProtectedItemsClient) testFailoverCleanupCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, cleanupInput) + if err := runtime.MarshalAsJSON(req, cleanupInput); err != nil { + return nil, err + } + return req, nil } // BeginUnplannedFailover - Operation to initiate a failover of the replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Unique fabric name. @@ -1508,7 +1588,8 @@ func (client *ReplicationProtectedItemsClient) BeginUnplannedFailover(ctx contex if err != nil { return nil, err } - return runtime.NewPoller[ReplicationProtectedItemsClientUnplannedFailoverResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationProtectedItemsClientUnplannedFailoverResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectedItemsClientUnplannedFailoverResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -1517,20 +1598,22 @@ func (client *ReplicationProtectedItemsClient) BeginUnplannedFailover(ctx contex // UnplannedFailover - Operation to initiate a failover of the replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectedItemsClient) unplannedFailover(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput UnplannedFailoverInput, options *ReplicationProtectedItemsClientBeginUnplannedFailoverOptions) (*http.Response, error) { + var err error req, err := client.unplannedFailoverCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // unplannedFailoverCreateRequest creates the UnplannedFailover request. @@ -1565,16 +1648,19 @@ func (client *ReplicationProtectedItemsClient) unplannedFailoverCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, failoverInput) + if err := runtime.MarshalAsJSON(req, failoverInput); err != nil { + return nil, err + } + return req, nil } // BeginUpdate - The operation to update the recovery settings of an ASR replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -1589,7 +1675,8 @@ func (client *ReplicationProtectedItemsClient) BeginUpdate(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[ReplicationProtectedItemsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationProtectedItemsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectedItemsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -1598,20 +1685,22 @@ func (client *ReplicationProtectedItemsClient) BeginUpdate(ctx context.Context, // Update - The operation to update the recovery settings of an ASR replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectedItemsClient) update(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput UpdateReplicationProtectedItemInput, options *ReplicationProtectedItemsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, updateProtectionInput, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -1646,16 +1735,19 @@ func (client *ReplicationProtectedItemsClient) updateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, updateProtectionInput) + if err := runtime.MarshalAsJSON(req, updateProtectionInput); err != nil { + return nil, err + } + return req, nil } // BeginUpdateAppliance - The operation to update appliance of an ASR replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -1670,7 +1762,8 @@ func (client *ReplicationProtectedItemsClient) BeginUpdateAppliance(ctx context. if err != nil { return nil, err } - return runtime.NewPoller[ReplicationProtectedItemsClientUpdateApplianceResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationProtectedItemsClientUpdateApplianceResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectedItemsClientUpdateApplianceResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -1679,20 +1772,22 @@ func (client *ReplicationProtectedItemsClient) BeginUpdateAppliance(ctx context. // UpdateAppliance - The operation to update appliance of an ASR replication protected item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectedItemsClient) updateAppliance(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput UpdateApplianceForReplicationProtectedItemInput, options *ReplicationProtectedItemsClientBeginUpdateApplianceOptions) (*http.Response, error) { + var err error req, err := client.updateApplianceCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, applianceUpdateInput, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateApplianceCreateRequest creates the UpdateAppliance request. @@ -1727,17 +1822,20 @@ func (client *ReplicationProtectedItemsClient) updateApplianceCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, applianceUpdateInput) + if err := runtime.MarshalAsJSON(req, applianceUpdateInput); err != nil { + return nil, err + } + return req, nil } // BeginUpdateMobilityService - The operation to update(push update) the installed mobility service software on a replication // protected item to the latest available version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - The name of the fabric containing the protected item. @@ -1752,9 +1850,10 @@ func (client *ReplicationProtectedItemsClient) BeginUpdateMobilityService(ctx co if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReplicationProtectedItemsClientUpdateMobilityServiceResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReplicationProtectedItemsClientUpdateMobilityServiceResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectedItemsClientUpdateMobilityServiceResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -1764,20 +1863,22 @@ func (client *ReplicationProtectedItemsClient) BeginUpdateMobilityService(ctx co // item to the latest available version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectedItemsClient) updateMobilityService(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateMobilityServiceRequest UpdateMobilityServiceRequest, options *ReplicationProtectedItemsClientBeginUpdateMobilityServiceOptions) (*http.Response, error) { + var err error req, err := client.updateMobilityServiceCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, updateMobilityServiceRequest, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateMobilityServiceCreateRequest creates the UpdateMobilityService request. @@ -1812,8 +1913,11 @@ func (client *ReplicationProtectedItemsClient) updateMobilityServiceCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, updateMobilityServiceRequest) + if err := runtime.MarshalAsJSON(req, updateMobilityServiceRequest); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotecteditems_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotecteditems_client_example_test.go deleted file mode 100644 index 4de0d5c46da2..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotecteditems_client_example_test.go +++ /dev/null @@ -1,1464 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_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/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_ListByReplicationProtectionContainers.json -func ExampleReplicationProtectedItemsClient_NewListByReplicationProtectionContainersPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationProtectedItemsClient().NewListByReplicationProtectionContainersPager("vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ReplicationProtectedItemCollection = armrecoveryservicessiterecovery.ReplicationProtectedItemCollection{ - // Value: []*armrecoveryservicessiterecovery.ReplicationProtectedItem{ - // { - // Name: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // Properties: &armrecoveryservicessiterecovery.ReplicationProtectedItemProperties{ - // ActiveLocation: to.Ptr("Primary"), - // AllowedOperations: []*string{ - // to.Ptr("PlannedFailover"), - // to.Ptr("UnplannedFailover"), - // to.Ptr("DisableProtection"), - // to.Ptr("TestFailover")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/None"), - // ScenarioName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1753-01-01T01:01:01Z"); return t}()), - // }, - // FriendlyName: to.Ptr("vm1"), - // PolicyFriendlyName: to.Ptr("protectionprofile1"), - // PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryProtectionContainerFriendlyName: to.Ptr("cloud1"), - // ProtectableItemID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectableItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // ProtectedItemType: to.Ptr("HyperVVirtualMachine"), - // ProtectionState: to.Ptr("Protected"), - // ProtectionStateDescription: to.Ptr("Protected"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzureReplicationDetails{ - // InstanceType: to.Ptr("HyperVReplicaAzure"), - // }, - // RecoveryContainerID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5/replicationProtectionContainers/d38048d4-b460-4791-8ece-108395ee8478"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // RecoveryProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryServicesProviderID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/241641e6-ee7b-4ee4-8141-821fadda43fa"), - // ReplicationHealth: to.Ptr("Normal"), - // TestFailoverState: to.Ptr("None"), - // TestFailoverStateDescription: to.Ptr("None"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Get.json -func ExampleReplicationProtectedItemsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationProtectedItemsClient().Get(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationProtectedItem = armrecoveryservicessiterecovery.ReplicationProtectedItem{ - // Name: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // Properties: &armrecoveryservicessiterecovery.ReplicationProtectedItemProperties{ - // ActiveLocation: to.Ptr("Primary"), - // AllowedOperations: []*string{ - // to.Ptr("PlannedFailover"), - // to.Ptr("UnplannedFailover"), - // to.Ptr("DisableProtection"), - // to.Ptr("TestFailover")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/None"), - // ScenarioName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1753-01-01T01:01:01Z"); return t}()), - // }, - // FriendlyName: to.Ptr("vm1"), - // PolicyFriendlyName: to.Ptr("protectionprofile1"), - // PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryProtectionContainerFriendlyName: to.Ptr("cloud1"), - // ProtectableItemID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectableItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // ProtectedItemType: to.Ptr("HyperVVirtualMachine"), - // ProtectionState: to.Ptr("Protected"), - // ProtectionStateDescription: to.Ptr("Protected"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzureReplicationDetails{ - // InstanceType: to.Ptr("HyperVReplicaAzure"), - // }, - // RecoveryContainerID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5/replicationProtectionContainers/d38048d4-b460-4791-8ece-108395ee8478"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // RecoveryProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryServicesProviderID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/241641e6-ee7b-4ee4-8141-821fadda43fa"), - // ReplicationHealth: to.Ptr("Normal"), - // TestFailoverState: to.Ptr("None"), - // TestFailoverStateDescription: to.Ptr("None"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Create.json -func ExampleReplicationProtectedItemsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectedItemsClient().BeginCreate(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", armrecoveryservicessiterecovery.EnableProtectionInput{ - Properties: &armrecoveryservicessiterecovery.EnableProtectionInputProperties{ - PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - ProtectableItemID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectableItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzureEnableProtectionInput{ - InstanceType: to.Ptr("HyperVReplicaAzure"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationProtectedItem = armrecoveryservicessiterecovery.ReplicationProtectedItem{ - // Name: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // Properties: &armrecoveryservicessiterecovery.ReplicationProtectedItemProperties{ - // ActiveLocation: to.Ptr("Primary"), - // AllowedOperations: []*string{ - // to.Ptr("PlannedFailover"), - // to.Ptr("UnplannedFailover"), - // to.Ptr("DisableProtection"), - // to.Ptr("TestFailover")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/None"), - // ScenarioName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1753-01-01T01:01:01Z"); return t}()), - // }, - // FriendlyName: to.Ptr("vm1"), - // PolicyFriendlyName: to.Ptr("protectionprofile1"), - // PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryProtectionContainerFriendlyName: to.Ptr("cloud1"), - // ProtectableItemID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectableItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // ProtectedItemType: to.Ptr("HyperVVirtualMachine"), - // ProtectionState: to.Ptr("Protected"), - // ProtectionStateDescription: to.Ptr("Protected"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzureReplicationDetails{ - // InstanceType: to.Ptr("HyperVReplicaAzure"), - // }, - // RecoveryContainerID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5/replicationProtectionContainers/d38048d4-b460-4791-8ece-108395ee8478"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // RecoveryProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryServicesProviderID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/241641e6-ee7b-4ee4-8141-821fadda43fa"), - // ReplicationHealth: to.Ptr("Normal"), - // TestFailoverState: to.Ptr("None"), - // TestFailoverStateDescription: to.Ptr("None"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Purge.json -func ExampleReplicationProtectedItemsClient_BeginPurge() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectedItemsClient().BeginPurge(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "c0c14913-3d7a-48ea-9531-cc99e0e686e6", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Update.json -func ExampleReplicationProtectedItemsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectedItemsClient().BeginUpdate(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", armrecoveryservicessiterecovery.UpdateReplicationProtectedItemInput{ - Properties: &armrecoveryservicessiterecovery.UpdateReplicationProtectedItemInputProperties{ - LicenseType: to.Ptr(armrecoveryservicessiterecovery.LicenseTypeWindowsServer), - ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzureUpdateReplicationProtectedItemInput{ - InstanceType: to.Ptr("HyperVReplicaAzure"), - }, - RecoveryAzureVMName: to.Ptr("vm1"), - RecoveryAzureVMSize: to.Ptr("Basic_A0"), - SelectedRecoveryAzureNetworkID: to.Ptr("/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai"), - VMNics: []*armrecoveryservicessiterecovery.VMNicInputDetails{ - { - IPConfigs: []*armrecoveryservicessiterecovery.IPConfigInputDetails{ - { - IPConfigName: to.Ptr("ipconfig1"), - IsPrimary: to.Ptr(true), - RecoveryStaticIPAddress: to.Ptr("10.0.2.46"), - RecoverySubnetName: to.Ptr("subnet1"), - }}, - NicID: to.Ptr("TWljcm9zb2Z0OkY4NDkxRTRGLTgxN0EtNDBERC1BOTBDLUFGNzczOTc4Qzc1Qlw3NjAwMzMxRS03NDk4LTQ0QTQtQjdDNy0xQjY1NkJDREQ1MkQ="), - SelectionType: to.Ptr("SelectedByUser"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationProtectedItem = armrecoveryservicessiterecovery.ReplicationProtectedItem{ - // Name: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // Properties: &armrecoveryservicessiterecovery.ReplicationProtectedItemProperties{ - // ActiveLocation: to.Ptr("Primary"), - // AllowedOperations: []*string{ - // to.Ptr("PlannedFailover"), - // to.Ptr("UnplannedFailover"), - // to.Ptr("DisableProtection"), - // to.Ptr("TestFailover")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/None"), - // ScenarioName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1753-01-01T01:01:01Z"); return t}()), - // }, - // FriendlyName: to.Ptr("vm1"), - // PolicyFriendlyName: to.Ptr("protectionprofile1"), - // PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryProtectionContainerFriendlyName: to.Ptr("cloud1"), - // ProtectableItemID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectableItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // ProtectedItemType: to.Ptr("HyperVVirtualMachine"), - // ProtectionState: to.Ptr("Protected"), - // ProtectionStateDescription: to.Ptr("Protected"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzureReplicationDetails{ - // InstanceType: to.Ptr("HyperVReplicaAzure"), - // }, - // RecoveryContainerID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5/replicationProtectionContainers/d38048d4-b460-4791-8ece-108395ee8478"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // RecoveryProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryServicesProviderID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/241641e6-ee7b-4ee4-8141-821fadda43fa"), - // ReplicationHealth: to.Ptr("Normal"), - // TestFailoverState: to.Ptr("None"), - // TestFailoverStateDescription: to.Ptr("None"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_AddDisks.json -func ExampleReplicationProtectedItemsClient_BeginAddDisks() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectedItemsClient().BeginAddDisks(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", armrecoveryservicessiterecovery.AddDisksInput{ - Properties: &armrecoveryservicessiterecovery.AddDisksInputProperties{ - ProviderSpecificDetails: &armrecoveryservicessiterecovery.A2AAddDisksInput{ - InstanceType: to.Ptr("A2A"), - VMDisks: []*armrecoveryservicessiterecovery.A2AVMDiskInputDetails{ - { - DiskURI: to.Ptr("https://vmstorage.blob.core.windows.net/vhds/datadisk1.vhd"), - PrimaryStagingAzureStorageAccountID: to.Ptr("/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourcegroups/primaryResource/providers/Microsoft.Storage/storageAccounts/vmcachestorage"), - RecoveryAzureStorageAccountID: to.Ptr("/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourcegroups/recoveryResource/providers/Microsoft.Storage/storageAccounts/recoverystorage"), - }}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationProtectedItem = armrecoveryservicessiterecovery.ReplicationProtectedItem{ - // Name: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // Properties: &armrecoveryservicessiterecovery.ReplicationProtectedItemProperties{ - // ActiveLocation: to.Ptr("Primary"), - // AllowedOperations: []*string{ - // to.Ptr("RepairReplication"), - // to.Ptr("UnplannedFailover"), - // to.Ptr("DisableProtection"), - // to.Ptr("TestFailover")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/None"), - // ScenarioName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1752-12-31T19:31:01Z"); return t}()), - // }, - // FailoverHealth: to.Ptr("Normal"), - // FriendlyName: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // HealthErrors: []*armrecoveryservicessiterecovery.HealthError{ - // }, - // PolicyFriendlyName: to.Ptr("A2APolicy"), - // PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/A2APolicy"), - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryFabricProvider: to.Ptr("AzureFabric"), - // PrimaryProtectionContainerFriendlyName: to.Ptr("cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"), - // ProtectedItemType: to.Ptr(""), - // ProtectionState: to.Ptr("Protected"), - // ProtectionStateDescription: to.Ptr("Protected"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.A2AReplicationDetails{ - // InstanceType: to.Ptr("A2A"), - // }, - // RecoveryContainerID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud2/replicationProtectionContainers/cloud_81224fc6-f326-5d35-96de-fbf51efb3188"), - // RecoveryFabricFriendlyName: to.Ptr("cloud2"), - // RecoveryFabricID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud2"), - // RecoveryProtectionContainerFriendlyName: to.Ptr("cloud_81224fc6-f326-5d35-96de-fbf51efb3188"), - // RecoveryServicesProviderID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/6d2940f9-4c34-5989-9f56-1243a6e76ecf"), - // ReplicationHealth: to.Ptr("Normal"), - // TestFailoverState: to.Ptr("None"), - // TestFailoverStateDescription: to.Ptr("None"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_ApplyRecoveryPoint.json -func ExampleReplicationProtectedItemsClient_BeginApplyRecoveryPoint() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectedItemsClient().BeginApplyRecoveryPoint(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", armrecoveryservicessiterecovery.ApplyRecoveryPointInput{ - Properties: &armrecoveryservicessiterecovery.ApplyRecoveryPointInputProperties{ - ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzureApplyRecoveryPointInput{ - InstanceType: to.Ptr("HyperVReplicaAzure"), - }, - RecoveryPointID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b/recoveryPoints/e4d05fe9-5dfd-47be-b50b-aad306b2802d"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationProtectedItem = armrecoveryservicessiterecovery.ReplicationProtectedItem{ - // Name: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // Properties: &armrecoveryservicessiterecovery.ReplicationProtectedItemProperties{ - // ActiveLocation: to.Ptr("Recovery"), - // AllowedOperations: []*string{ - // to.Ptr("CompleteMigration"), - // to.Ptr("Commit"), - // to.Ptr("DisableProtection"), - // to.Ptr("ChangePit")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/None"), - // ScenarioName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1753-01-01T01:01:01Z"); return t}()), - // }, - // FailoverRecoveryPointID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b/recoveryPoints/e4d05fe9-5dfd-47be-b50b-aad306b2802d"), - // FriendlyName: to.Ptr("vm1"), - // LastSuccessfulFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-26T08:42:33.0996129Z"); return t}()), - // LastSuccessfulTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-25T09:57:57.0357829Z"); return t}()), - // PolicyFriendlyName: to.Ptr("protectionprofile1"), - // PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryProtectionContainerFriendlyName: to.Ptr("cloud1"), - // ProtectableItemID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectableItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // ProtectedItemType: to.Ptr("HyperVVirtualMachine"), - // ProtectionState: to.Ptr("UnplannedFailoverCommitPendingStatesBegin"), - // ProtectionStateDescription: to.Ptr("Failover completed"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzureReplicationDetails{ - // InstanceType: to.Ptr("HyperVReplicaAzure"), - // }, - // RecoveryContainerID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5/replicationProtectionContainers/d38048d4-b460-4791-8ece-108395ee8478"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // RecoveryProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryServicesProviderID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/241641e6-ee7b-4ee4-8141-821fadda43fa"), - // ReplicationHealth: to.Ptr("Critical"), - // TestFailoverState: to.Ptr("MarkedForDeletion"), - // TestFailoverStateDescription: to.Ptr("Cleaning up test environment"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_FailoverCancel.json -func ExampleReplicationProtectedItemsClient_BeginFailoverCancel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectedItemsClient().BeginFailoverCancel(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationProtectedItem = armrecoveryservicessiterecovery.ReplicationProtectedItem{ - // Name: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // Properties: &armrecoveryservicessiterecovery.ReplicationProtectedItemProperties{ - // ActiveLocation: to.Ptr("Primary"), - // AllowedOperations: []*string{ - // to.Ptr("PlannedFailover"), - // to.Ptr("DisableProtection")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/None"), - // ScenarioName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-02-24T07:17:23.1358752Z"); return t}()), - // }, - // FailoverRecoveryPointID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b/recoveryPoints/b22134ea-620c-474b-9fa5-3c1cb47708e3"), - // FriendlyName: to.Ptr("vm1"), - // LastSuccessfulFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-02-24T06:37:23.1578655Z"); return t}()), - // LastSuccessfulTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1601-01-01T00:00:00.0000000Z"); return t}()), - // PolicyFriendlyName: to.Ptr("protectionprofile1"), - // PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryProtectionContainerFriendlyName: to.Ptr("cloud1"), - // ProtectableItemID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectableItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // ProtectedItemType: to.Ptr(""), - // ProtectionState: to.Ptr("Protected"), - // ProtectionStateDescription: to.Ptr("Protected"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.InMageRcmFailbackReplicationDetails{ - // InstanceType: to.Ptr("InMageRcmFailback"), - // }, - // RecoveryContainerID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"), - // RecoveryFabricFriendlyName: to.Ptr("cloud1"), - // RecoveryFabricID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1"), - // RecoveryProtectionContainerFriendlyName: to.Ptr("cloud1"), - // RecoveryServicesProviderID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/241641e6-ee7b-4ee4-8141-821fadda43fa"), - // ReplicationHealth: to.Ptr("Normal"), - // TestFailoverState: to.Ptr("None"), - // TestFailoverStateDescription: to.Ptr("None"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_FailoverCommit.json -func ExampleReplicationProtectedItemsClient_BeginFailoverCommit() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectedItemsClient().BeginFailoverCommit(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationProtectedItem = armrecoveryservicessiterecovery.ReplicationProtectedItem{ - // Name: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // Properties: &armrecoveryservicessiterecovery.ReplicationProtectedItemProperties{ - // ActiveLocation: to.Ptr("Recovery"), - // AllowedOperations: []*string{ - // to.Ptr("CompleteMigration"), - // to.Ptr("DisableProtection"), - // to.Ptr("Failback")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/None"), - // ScenarioName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1753-01-01T01:01:01Z"); return t}()), - // }, - // FailoverRecoveryPointID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b/recoveryPoints/b22134ea-620c-474b-9fa5-3c1cb47708e3"), - // FriendlyName: to.Ptr("vm1"), - // LastSuccessfulFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-26T06:37:23.1578655Z"); return t}()), - // LastSuccessfulTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-25T09:57:57.0357829Z"); return t}()), - // PolicyFriendlyName: to.Ptr("protectionprofile1"), - // PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryProtectionContainerFriendlyName: to.Ptr("cloud1"), - // ProtectableItemID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectableItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // ProtectedItemType: to.Ptr("HyperVVirtualMachine"), - // ProtectionState: to.Ptr("PlannedFailoverStatesBegin"), - // ProtectionStateDescription: to.Ptr("Planned failover committed"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzureReplicationDetails{ - // InstanceType: to.Ptr("HyperVReplicaAzure"), - // }, - // RecoveryContainerID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5/replicationProtectionContainers/d38048d4-b460-4791-8ece-108395ee8478"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // RecoveryProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryServicesProviderID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/241641e6-ee7b-4ee4-8141-821fadda43fa"), - // ReplicationHealth: to.Ptr("Normal"), - // TestFailoverState: to.Ptr("MarkedForDeletion"), - // TestFailoverStateDescription: to.Ptr("Cleaning up test environment"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_PlannedFailover.json -func ExampleReplicationProtectedItemsClient_BeginPlannedFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectedItemsClient().BeginPlannedFailover(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", armrecoveryservicessiterecovery.PlannedFailoverInput{ - Properties: &armrecoveryservicessiterecovery.PlannedFailoverInputProperties{ - FailoverDirection: to.Ptr("PrimaryToRecovery"), - ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzurePlannedFailoverProviderInput{ - InstanceType: to.Ptr("HyperVReplicaAzure"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationProtectedItem = armrecoveryservicessiterecovery.ReplicationProtectedItem{ - // Name: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // Properties: &armrecoveryservicessiterecovery.ReplicationProtectedItemProperties{ - // ActiveLocation: to.Ptr("Recovery"), - // AllowedOperations: []*string{ - // to.Ptr("CompleteMigration"), - // to.Ptr("Commit"), - // to.Ptr("DisableProtection"), - // to.Ptr("ChangePit")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/None"), - // ScenarioName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1753-01-01T01:01:01Z"); return t}()), - // }, - // FailoverRecoveryPointID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b/recoveryPoints/b22134ea-620c-474b-9fa5-3c1cb47708e3"), - // FriendlyName: to.Ptr("vm1"), - // LastSuccessfulFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-26T06:37:23.1578655Z"); return t}()), - // LastSuccessfulTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-25T09:57:57.0357829Z"); return t}()), - // PolicyFriendlyName: to.Ptr("protectionprofile1"), - // PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryProtectionContainerFriendlyName: to.Ptr("cloud1"), - // ProtectableItemID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectableItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // ProtectedItemType: to.Ptr("HyperVVirtualMachine"), - // ProtectionState: to.Ptr("PlannedFailoverCommitRequired"), - // ProtectionStateDescription: to.Ptr("Planned failover finished"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzureReplicationDetails{ - // InstanceType: to.Ptr("HyperVReplicaAzure"), - // }, - // RecoveryContainerID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5/replicationProtectionContainers/d38048d4-b460-4791-8ece-108395ee8478"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // RecoveryProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryServicesProviderID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/241641e6-ee7b-4ee4-8141-821fadda43fa"), - // ReplicationHealth: to.Ptr("Normal"), - // TestFailoverState: to.Ptr("MarkedForDeletion"), - // TestFailoverStateDescription: to.Ptr("Cleaning up test environment"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Delete.json -func ExampleReplicationProtectedItemsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectedItemsClient().BeginDelete(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "c0c14913-3d7a-48ea-9531-cc99e0e686e6", armrecoveryservicessiterecovery.DisableProtectionInput{ - Properties: &armrecoveryservicessiterecovery.DisableProtectionInputProperties{ - ReplicationProviderInput: &armrecoveryservicessiterecovery.DisableProtectionProviderSpecificInput{ - InstanceType: to.Ptr("DisableProtectionProviderSpecificInput"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_RemoveDisks.json -func ExampleReplicationProtectedItemsClient_BeginRemoveDisks() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectedItemsClient().BeginRemoveDisks(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", armrecoveryservicessiterecovery.RemoveDisksInput{ - Properties: &armrecoveryservicessiterecovery.RemoveDisksInputProperties{ - ProviderSpecificDetails: &armrecoveryservicessiterecovery.A2ARemoveDisksInput{ - InstanceType: to.Ptr("A2A"), - VMDisksUris: []*string{ - to.Ptr("https://vmstorage.blob.core.windows.net/vhds/datadisk1.vhd")}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationProtectedItem = armrecoveryservicessiterecovery.ReplicationProtectedItem{ - // Name: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // Properties: &armrecoveryservicessiterecovery.ReplicationProtectedItemProperties{ - // ActiveLocation: to.Ptr("Primary"), - // AllowedOperations: []*string{ - // to.Ptr("RepairReplication"), - // to.Ptr("UnplannedFailover"), - // to.Ptr("DisableProtection"), - // to.Ptr("TestFailover")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/None"), - // ScenarioName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1752-12-31T19:31:01Z"); return t}()), - // }, - // FailoverHealth: to.Ptr("Normal"), - // FriendlyName: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // HealthErrors: []*armrecoveryservicessiterecovery.HealthError{ - // }, - // PolicyFriendlyName: to.Ptr("A2APolicy"), - // PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/A2APolicy"), - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryFabricProvider: to.Ptr("AzureFabric"), - // PrimaryProtectionContainerFriendlyName: to.Ptr("cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"), - // ProtectedItemType: to.Ptr(""), - // ProtectionState: to.Ptr("Protected"), - // ProtectionStateDescription: to.Ptr("Protected"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.A2AReplicationDetails{ - // InstanceType: to.Ptr("A2A"), - // }, - // RecoveryContainerID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud2/replicationProtectionContainers/cloud_81224fc6-f326-5d35-96de-fbf51efb3188"), - // RecoveryFabricFriendlyName: to.Ptr("cloud2"), - // RecoveryFabricID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud2"), - // RecoveryProtectionContainerFriendlyName: to.Ptr("cloud_81224fc6-f326-5d35-96de-fbf51efb3188"), - // RecoveryServicesProviderID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/6d2940f9-4c34-5989-9f56-1243a6e76ecf"), - // ReplicationHealth: to.Ptr("Normal"), - // TestFailoverState: to.Ptr("None"), - // TestFailoverStateDescription: to.Ptr("None"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_RepairReplication.json -func ExampleReplicationProtectedItemsClient_BeginRepairReplication() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectedItemsClient().BeginRepairReplication(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationProtectedItem = armrecoveryservicessiterecovery.ReplicationProtectedItem{ - // Name: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // Properties: &armrecoveryservicessiterecovery.ReplicationProtectedItemProperties{ - // ActiveLocation: to.Ptr("Primary"), - // AllowedOperations: []*string{ - // to.Ptr("PlannedFailover"), - // to.Ptr("UnplannedFailover"), - // to.Ptr("DisableProtection"), - // to.Ptr("TestFailover")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/None"), - // ScenarioName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1753-01-01T01:01:01Z"); return t}()), - // }, - // FriendlyName: to.Ptr("vm1"), - // PolicyFriendlyName: to.Ptr("protectionprofile1"), - // PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryProtectionContainerFriendlyName: to.Ptr("cloud1"), - // ProtectableItemID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectableItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // ProtectedItemType: to.Ptr("HyperVVirtualMachine"), - // ProtectionState: to.Ptr("Protected"), - // ProtectionStateDescription: to.Ptr("Protected"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzureReplicationDetails{ - // InstanceType: to.Ptr("HyperVReplicaAzure"), - // }, - // RecoveryContainerID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5/replicationProtectionContainers/d38048d4-b460-4791-8ece-108395ee8478"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // RecoveryProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryServicesProviderID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/241641e6-ee7b-4ee4-8141-821fadda43fa"), - // ReplicationHealth: to.Ptr("Normal"), - // TestFailoverState: to.Ptr("None"), - // TestFailoverStateDescription: to.Ptr("None"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Reprotect.json -func ExampleReplicationProtectedItemsClient_BeginReprotect() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectedItemsClient().BeginReprotect(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", armrecoveryservicessiterecovery.ReverseReplicationInput{ - Properties: &armrecoveryservicessiterecovery.ReverseReplicationInputProperties{ - FailoverDirection: to.Ptr("PrimaryToRecovery"), - ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzureReprotectInput{ - InstanceType: to.Ptr("HyperVReplicaAzure"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationProtectedItem = armrecoveryservicessiterecovery.ReplicationProtectedItem{ - // Name: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // Properties: &armrecoveryservicessiterecovery.ReplicationProtectedItemProperties{ - // ActiveLocation: to.Ptr("Primary"), - // AllowedOperations: []*string{ - // to.Ptr("PlannedFailover"), - // to.Ptr("UnplannedFailover"), - // to.Ptr("DisableProtection"), - // to.Ptr("TestFailover")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/None"), - // ScenarioName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1753-01-01T01:01:01Z"); return t}()), - // }, - // FailoverRecoveryPointID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b/recoveryPoints/b22134ea-620c-474b-9fa5-3c1cb47708e3"), - // FriendlyName: to.Ptr("vm1"), - // LastSuccessfulFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-26T06:37:23.1578655Z"); return t}()), - // LastSuccessfulTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-25T09:57:57.0357829Z"); return t}()), - // PolicyFriendlyName: to.Ptr("protectionprofile1"), - // PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryProtectionContainerFriendlyName: to.Ptr("cloud1"), - // ProtectableItemID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectableItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // ProtectedItemType: to.Ptr("HyperVVirtualMachine"), - // ProtectionState: to.Ptr("Protected"), - // ProtectionStateDescription: to.Ptr("Protected"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzureReplicationDetails{ - // InstanceType: to.Ptr("HyperVReplicaAzure"), - // }, - // RecoveryContainerID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5/replicationProtectionContainers/d38048d4-b460-4791-8ece-108395ee8478"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // RecoveryProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryServicesProviderID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/241641e6-ee7b-4ee4-8141-821fadda43fa"), - // ReplicationHealth: to.Ptr("Normal"), - // TestFailoverState: to.Ptr("MarkedForDeletion"), - // TestFailoverStateDescription: to.Ptr("Cleaning up test environment"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_ResolveHealthErrors.json -func ExampleReplicationProtectedItemsClient_BeginResolveHealthErrors() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectedItemsClient().BeginResolveHealthErrors(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", armrecoveryservicessiterecovery.ResolveHealthInput{ - Properties: &armrecoveryservicessiterecovery.ResolveHealthInputProperties{ - HealthErrors: []*armrecoveryservicessiterecovery.ResolveHealthError{ - { - HealthErrorID: to.Ptr("3:8020"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationProtectedItem = armrecoveryservicessiterecovery.ReplicationProtectedItem{ - // Name: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // Properties: &armrecoveryservicessiterecovery.ReplicationProtectedItemProperties{ - // ActiveLocation: to.Ptr("Primary"), - // AllowedOperations: []*string{ - // to.Ptr("RepairReplication"), - // to.Ptr("UnplannedFailover"), - // to.Ptr("DisableProtection"), - // to.Ptr("TestFailover")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/None"), - // ScenarioName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1752-12-31T19:31:01Z"); return t}()), - // }, - // FailoverHealth: to.Ptr("Normal"), - // FriendlyName: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // HealthErrors: []*armrecoveryservicessiterecovery.HealthError{ - // }, - // PolicyFriendlyName: to.Ptr("A2APolicy"), - // PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/A2APolicy"), - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryFabricProvider: to.Ptr("AzureFabric"), - // PrimaryProtectionContainerFriendlyName: to.Ptr("cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"), - // ProtectedItemType: to.Ptr(""), - // ProtectionState: to.Ptr("Protected"), - // ProtectionStateDescription: to.Ptr("Protected"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.A2AReplicationDetails{ - // InstanceType: to.Ptr("A2A"), - // }, - // RecoveryContainerID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud2/replicationProtectionContainers/cloud_81224fc6-f326-5d35-96de-fbf51efb3188"), - // RecoveryFabricFriendlyName: to.Ptr("cloud2"), - // RecoveryFabricID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud2"), - // RecoveryProtectionContainerFriendlyName: to.Ptr("cloud_81224fc6-f326-5d35-96de-fbf51efb3188"), - // RecoveryServicesProviderID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/6d2940f9-4c34-5989-9f56-1243a6e76ecf"), - // ReplicationHealth: to.Ptr("Normal"), - // TestFailoverState: to.Ptr("None"), - // TestFailoverStateDescription: to.Ptr("None"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_SwitchProvider.json -func ExampleReplicationProtectedItemsClient_BeginSwitchProvider() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectedItemsClient().BeginSwitchProvider(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", armrecoveryservicessiterecovery.SwitchProviderInput{ - Properties: &armrecoveryservicessiterecovery.SwitchProviderInputProperties{ - ProviderSpecificDetails: &armrecoveryservicessiterecovery.InMageAzureV2SwitchProviderInput{ - InstanceType: to.Ptr("InMageAzureV2"), - TargetApplianceID: to.Ptr("5efaa202-e958-435e-8171-706bf735fcc4"), - TargetFabricID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud2"), - TargetVaultID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault2"), - }, - TargetInstanceType: to.Ptr("InMageRcm"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationProtectedItem = armrecoveryservicessiterecovery.ReplicationProtectedItem{ - // Name: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // Properties: &armrecoveryservicessiterecovery.ReplicationProtectedItemProperties{ - // ActiveLocation: to.Ptr("Recovery"), - // AllowedOperations: []*string{ - // to.Ptr("CompleteMigration"), - // to.Ptr("Commit"), - // to.Ptr("DisableProtection"), - // to.Ptr("ChangePit")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/None"), - // ScenarioName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1753-01-01T01:01:01Z"); return t}()), - // }, - // FailoverRecoveryPointID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b/recoveryPoints/b22134ea-620c-474b-9fa5-3c1cb47708e3"), - // FriendlyName: to.Ptr("vm1"), - // LastSuccessfulFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-26T06:37:23.1578655Z"); return t}()), - // LastSuccessfulTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-25T09:57:57.0357829Z"); return t}()), - // PolicyFriendlyName: to.Ptr("protectionprofile1"), - // PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryProtectionContainerFriendlyName: to.Ptr("cloud1"), - // ProtectableItemID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectableItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // ProtectedItemType: to.Ptr("HyperVVirtualMachine"), - // ProtectionState: to.Ptr("PlannedFailoverCommitRequired"), - // ProtectionStateDescription: to.Ptr("Planned failover finished"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzureReplicationDetails{ - // InstanceType: to.Ptr("HyperVReplicaAzure"), - // }, - // RecoveryContainerID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5/replicationProtectionContainers/d38048d4-b460-4791-8ece-108395ee8478"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // RecoveryProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryServicesProviderID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/241641e6-ee7b-4ee4-8141-821fadda43fa"), - // ReplicationHealth: to.Ptr("Normal"), - // TestFailoverState: to.Ptr("MarkedForDeletion"), - // TestFailoverStateDescription: to.Ptr("Cleaning up test environment"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_TestFailover.json -func ExampleReplicationProtectedItemsClient_BeginTestFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectedItemsClient().BeginTestFailover(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", armrecoveryservicessiterecovery.TestFailoverInput{ - Properties: &armrecoveryservicessiterecovery.TestFailoverInputProperties{ - FailoverDirection: to.Ptr("PrimaryToRecovery"), - NetworkID: to.Ptr("/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai"), - NetworkType: to.Ptr("VmNetworkAsInput"), - ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzureTestFailoverInput{ - InstanceType: to.Ptr("HyperVReplicaAzure"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationProtectedItem = armrecoveryservicessiterecovery.ReplicationProtectedItem{ - // Name: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // Properties: &armrecoveryservicessiterecovery.ReplicationProtectedItemProperties{ - // ActiveLocation: to.Ptr("Primary"), - // AllowedOperations: []*string{ - // to.Ptr("TestFailoverCleanup")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/2838f9b4-2609-4f76-a7e9-07e6387c5e98"), - // ScenarioName: to.Ptr("TestFailover"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-25T09:57:57.0357829Z"); return t}()), - // }, - // FailoverRecoveryPointID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b/recoveryPoints/0689d0d0-3518-4793-8c98-c26bf94526f6"), - // FriendlyName: to.Ptr("vm1"), - // PolicyFriendlyName: to.Ptr("protectionprofile1"), - // PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryProtectionContainerFriendlyName: to.Ptr("cloud1"), - // ProtectableItemID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectableItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // ProtectedItemType: to.Ptr("HyperVVirtualMachine"), - // ProtectionState: to.Ptr("Protected"), - // ProtectionStateDescription: to.Ptr("Cleanup test failover pending"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzureReplicationDetails{ - // InstanceType: to.Ptr("HyperVReplicaAzure"), - // }, - // RecoveryContainerID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5/replicationProtectionContainers/d38048d4-b460-4791-8ece-108395ee8478"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // RecoveryProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryServicesProviderID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/241641e6-ee7b-4ee4-8141-821fadda43fa"), - // ReplicationHealth: to.Ptr("Normal"), - // TestFailoverState: to.Ptr("WaitingForCompletion"), - // TestFailoverStateDescription: to.Ptr("Waiting for user input"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_TestFailoverCleanup.json -func ExampleReplicationProtectedItemsClient_BeginTestFailoverCleanup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectedItemsClient().BeginTestFailoverCleanup(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", armrecoveryservicessiterecovery.TestFailoverCleanupInput{ - Properties: &armrecoveryservicessiterecovery.TestFailoverCleanupInputProperties{ - Comments: to.Ptr("Test Failover Cleanup"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationProtectedItem = armrecoveryservicessiterecovery.ReplicationProtectedItem{ - // Name: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // Properties: &armrecoveryservicessiterecovery.ReplicationProtectedItemProperties{ - // ActiveLocation: to.Ptr("Primary"), - // AllowedOperations: []*string{ - // to.Ptr("PlannedFailover"), - // to.Ptr("UnplannedFailover"), - // to.Ptr("DisableProtection"), - // to.Ptr("TestFailover")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/None"), - // ScenarioName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1753-01-01T01:01:01Z"); return t}()), - // }, - // FailoverRecoveryPointID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b/recoveryPoints/b22134ea-620c-474b-9fa5-3c1cb47708e3"), - // FriendlyName: to.Ptr("vm1"), - // LastSuccessfulFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-26T06:37:23.1578655Z"); return t}()), - // LastSuccessfulTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-25T09:57:57.0357829Z"); return t}()), - // PolicyFriendlyName: to.Ptr("protectionprofile1"), - // PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryProtectionContainerFriendlyName: to.Ptr("cloud1"), - // ProtectableItemID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectableItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // ProtectedItemType: to.Ptr("HyperVVirtualMachine"), - // ProtectionState: to.Ptr("Protected"), - // ProtectionStateDescription: to.Ptr("Protected"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzureReplicationDetails{ - // InstanceType: to.Ptr("HyperVReplicaAzure"), - // }, - // RecoveryContainerID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5/replicationProtectionContainers/d38048d4-b460-4791-8ece-108395ee8478"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // RecoveryProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryServicesProviderID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/241641e6-ee7b-4ee4-8141-821fadda43fa"), - // ReplicationHealth: to.Ptr("Normal"), - // TestFailoverState: to.Ptr("MarkedForDeletion"), - // TestFailoverStateDescription: to.Ptr("Cleaning up test environment"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_UnplannedFailover.json -func ExampleReplicationProtectedItemsClient_BeginUnplannedFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectedItemsClient().BeginUnplannedFailover(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "f8491e4f-817a-40dd-a90c-af773978c75b", armrecoveryservicessiterecovery.UnplannedFailoverInput{ - Properties: &armrecoveryservicessiterecovery.UnplannedFailoverInputProperties{ - FailoverDirection: to.Ptr("PrimaryToRecovery"), - ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzureUnplannedFailoverInput{ - InstanceType: to.Ptr("HyperVReplicaAzure"), - }, - SourceSiteOperations: to.Ptr("NotRequired"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationProtectedItem = armrecoveryservicessiterecovery.ReplicationProtectedItem{ - // Name: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // Properties: &armrecoveryservicessiterecovery.ReplicationProtectedItemProperties{ - // ActiveLocation: to.Ptr("Recovery"), - // AllowedOperations: []*string{ - // to.Ptr("CompleteMigration"), - // to.Ptr("Commit"), - // to.Ptr("DisableProtection"), - // to.Ptr("ChangePit")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/None"), - // ScenarioName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1753-01-01T01:01:01Z"); return t}()), - // }, - // FailoverRecoveryPointID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b/recoveryPoints/b2c7b208-0999-40a4-804f-8ee1019c8f76"), - // FriendlyName: to.Ptr("vm1"), - // LastSuccessfulFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-26T08:42:33.0996129Z"); return t}()), - // LastSuccessfulTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-25T09:57:57.0357829Z"); return t}()), - // PolicyFriendlyName: to.Ptr("protectionprofile1"), - // PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryProtectionContainerFriendlyName: to.Ptr("cloud1"), - // ProtectableItemID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectableItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // ProtectedItemType: to.Ptr("HyperVVirtualMachine"), - // ProtectionState: to.Ptr("UnplannedFailoverCommitPendingStatesBegin"), - // ProtectionStateDescription: to.Ptr("Failover completed"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzureReplicationDetails{ - // InstanceType: to.Ptr("HyperVReplicaAzure"), - // }, - // RecoveryContainerID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5/replicationProtectionContainers/d38048d4-b460-4791-8ece-108395ee8478"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // RecoveryProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryServicesProviderID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/241641e6-ee7b-4ee4-8141-821fadda43fa"), - // ReplicationHealth: to.Ptr("Normal"), - // TestFailoverState: to.Ptr("MarkedForDeletion"), - // TestFailoverStateDescription: to.Ptr("Cleaning up test environment"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_UpdateAppliance.json -func ExampleReplicationProtectedItemsClient_BeginUpdateAppliance() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectedItemsClient().BeginUpdateAppliance(ctx, "Ayan-0106-SA-Vault", "Ayan-0106-SA-RG", "Ayan-0106-SA-Vaultreplicationfabric", "Ayan-0106-SA-Vaultreplicationcontainer", "idclab-vcen67_50158124-8857-3e08-0893-2ddf8ebb8c1f", armrecoveryservicessiterecovery.UpdateApplianceForReplicationProtectedItemInput{ - Properties: &armrecoveryservicessiterecovery.UpdateApplianceForReplicationProtectedItemInputProperties{ - ProviderSpecificDetails: &armrecoveryservicessiterecovery.InMageRcmUpdateApplianceForReplicationProtectedItemInput{ - InstanceType: to.Ptr("InMageRcm"), - RunAsAccountID: to.Ptr(""), - }, - TargetApplianceID: to.Ptr(""), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationProtectedItem = armrecoveryservicessiterecovery.ReplicationProtectedItem{ - // Name: to.Ptr("idclab-vcen67_50158124-8857-3e08-0893-2ddf8ebb8c1f"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems"), - // ID: to.Ptr("/Subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/Ayan-0106-SA-RG/providers/Microsoft.RecoveryServices/vaults/Ayan-0106-SA-Vault/replicationFabrics/Ayan-0106-SA-Vaultreplicationfabric/replicationProtectionContainers/Ayan-0106-SA-Vaultreplicationcontainer/replicationProtectedItems/idclab-vcen67_50158124-8857-3e08-0893-2ddf8ebb8c1f"), - // Properties: &armrecoveryservicessiterecovery.ReplicationProtectedItemProperties{ - // ActiveLocation: to.Ptr("Primary"), - // AllowedOperations: []*string{ - // to.Ptr("UnplannedFailover"), - // to.Ptr("DisableProtection"), - // to.Ptr("TestFailover")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/Ayan-0106-SA-RG/providers/Microsoft.RecoveryServices/vaults/Ayan-0106-SA-Vault/replicationJobs/None"), - // ScenarioName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1753-01-01T01:01:01Z"); return t}()), - // }, - // EventCorrelationID: to.Ptr("fb40d161-cffd-44d9-a252-0b7978e1f73c"), - // FailoverHealth: to.Ptr("Normal"), - // FriendlyName: to.Ptr("Ayan-RHEL7-Test2"), - // HealthErrors: []*armrecoveryservicessiterecovery.HealthError{ - // }, - // PolicyFriendlyName: to.Ptr("24-hour-replication-policy"), - // PolicyID: to.Ptr("/Subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/Ayan-0106-SA-RG/providers/Microsoft.RecoveryServices/vaults/Ayan-0106-SA-Vault/replicationPolicies/24-hour-replication-policy"), - // PrimaryFabricFriendlyName: to.Ptr("Ayan-0106-SA-Vaultreplicationfabric"), - // PrimaryFabricProvider: to.Ptr("InMageRcmFabric"), - // PrimaryProtectionContainerFriendlyName: to.Ptr("Ayan-0106-SA-Vaultreplicationcontainer"), - // ProtectedItemType: to.Ptr(""), - // ProtectionState: to.Ptr("Protected"), - // ProtectionStateDescription: to.Ptr("Protected"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.InMageRcmReplicationDetails{ - // InstanceType: to.Ptr("InMageRcm"), - // }, - // RecoveryContainerID: to.Ptr("/Subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/Ayan-0106-SA-RG/providers/Microsoft.RecoveryServices/vaults/Ayan-0106-SA-Vault/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5/replicationProtectionContainers/d38048d4-b460-4791-8ece-108395ee8478"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // RecoveryProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryServicesProviderID: to.Ptr("/Subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/Ayan-0106-SA-RG/providers/Microsoft.RecoveryServices/vaults/Ayan-0106-SA-Vault/replicationFabrics/Ayan-0106-SA-Vaultreplicationfabric/replicationRecoveryServicesProviders/a552cf2d-bbb3-4d78-8145-e1992ecb31d1"), - // ReplicationHealth: to.Ptr("Normal"), - // TestFailoverState: to.Ptr("None"), - // TestFailoverStateDescription: to.Ptr("None"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_UpdateMobilityService.json -func ExampleReplicationProtectedItemsClient_BeginUpdateMobilityService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectedItemsClient().BeginUpdateMobilityService(ctx, "WCUSVault", "wcusValidations", "WIN-JKKJ31QI8U2", "cloud_c6780228-83bd-4f3e-a70e-cb46b7da33a0", "79dd20ab-2b40-11e7-9791-0050568f387e", armrecoveryservicessiterecovery.UpdateMobilityServiceRequest{ - Properties: &armrecoveryservicessiterecovery.UpdateMobilityServiceRequestProperties{ - RunAsAccountID: to.Ptr("2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationProtectedItem = armrecoveryservicessiterecovery.ReplicationProtectedItem{ - // Name: to.Ptr("79dd20ab-2b40-11e7-9791-0050568f387e"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems"), - // ID: to.Ptr("/Subscriptions/b364ed8d-4279-4bf8-8fd1-56f8fa0ae05c/resourceGroups/wcusValidations/providers/Microsoft.RecoveryServices/vaults/WCUSVault/replicationFabrics/d70b0326a201008a953505ef271dc908e5e23468bc7356862ea178696f5f15c7/replicationProtectionContainers/cloud_c6780228-83bd-4f3e-a70e-cb46b7da33a0/replicationProtectedItems/79dd20ab-2b40-11e7-9791-0050568f387e"), - // Properties: &armrecoveryservicessiterecovery.ReplicationProtectedItemProperties{ - // ActiveLocation: to.Ptr("Primary"), - // AllowedOperations: []*string{ - // to.Ptr("UnplannedFailover"), - // to.Ptr("DisableProtection"), - // to.Ptr("TestFailover")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/b364ed8d-4279-4bf8-8fd1-56f8fa0ae05c/resourceGroups/wcusValidations/providers/Microsoft.RecoveryServices/vaults/WCUSVault/replicationJobs/None"), - // ScenarioName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1753-01-01T01:01:01Z"); return t}()), - // }, - // FriendlyName: to.Ptr("MMR-LIN-V2A-3"), - // PolicyFriendlyName: to.Ptr("MadhaviPolicyNew"), - // PolicyID: to.Ptr("/Subscriptions/b364ed8d-4279-4bf8-8fd1-56f8fa0ae05c/resourceGroups/wcusValidations/providers/Microsoft.RecoveryServices/vaults/WCUSVault/replicationPolicies/MadhaviPolicyNew"), - // PrimaryFabricFriendlyName: to.Ptr("WIN-JKKJ31QI8U2"), - // PrimaryProtectionContainerFriendlyName: to.Ptr("WIN-JKKJ31QI8U2"), - // ProtectableItemID: to.Ptr("/Subscriptions/b364ed8d-4279-4bf8-8fd1-56f8fa0ae05c/resourceGroups/wcusValidations/providers/Microsoft.RecoveryServices/vaults/WCUSVault/replicationFabrics/d70b0326a201008a953505ef271dc908e5e23468bc7356862ea178696f5f15c7/replicationProtectionContainers/cloud_c6780228-83bd-4f3e-a70e-cb46b7da33a0/replicationProtectableItems/79dd20ab-2b40-11e7-9791-0050568f387e"), - // ProtectedItemType: to.Ptr(""), - // ProtectionState: to.Ptr("Protected"), - // ProtectionStateDescription: to.Ptr("Protected"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.InMageAzureV2ReplicationDetails{ - // InstanceType: to.Ptr("InMageAzureV2"), - // }, - // RecoveryContainerID: to.Ptr("/Subscriptions/b364ed8d-4279-4bf8-8fd1-56f8fa0ae05c/resourceGroups/wcusValidations/providers/Microsoft.RecoveryServices/vaults/WCUSVault/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5/replicationProtectionContainers/d38048d4-b460-4791-8ece-108395ee8478"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // RecoveryProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryServicesProviderID: to.Ptr("/Subscriptions/b364ed8d-4279-4bf8-8fd1-56f8fa0ae05c/resourceGroups/wcusValidations/providers/Microsoft.RecoveryServices/vaults/WCUSVault/replicationFabrics/d70b0326a201008a953505ef271dc908e5e23468bc7356862ea178696f5f15c7/replicationRecoveryServicesProviders/c6780228-83bd-4f3e-a70e-cb46b7da33a0"), - // ReplicationHealth: to.Ptr("Normal"), - // TestFailoverState: to.Ptr("None"), - // TestFailoverStateDescription: to.Ptr("None"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_List.json -func ExampleReplicationProtectedItemsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationProtectedItemsClient().NewListPager("vault1", "resourceGroupPS1", &armrecoveryservicessiterecovery.ReplicationProtectedItemsClientListOptions{SkipToken: nil, - Filter: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ReplicationProtectedItemCollection = armrecoveryservicessiterecovery.ReplicationProtectedItemCollection{ - // Value: []*armrecoveryservicessiterecovery.ReplicationProtectedItem{ - // { - // Name: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // Properties: &armrecoveryservicessiterecovery.ReplicationProtectedItemProperties{ - // ActiveLocation: to.Ptr("Primary"), - // AllowedOperations: []*string{ - // to.Ptr("PlannedFailover"), - // to.Ptr("UnplannedFailover"), - // to.Ptr("DisableProtection"), - // to.Ptr("TestFailover")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/None"), - // ScenarioName: to.Ptr("None"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1753-01-01T01:01:01Z"); return t}()), - // }, - // FriendlyName: to.Ptr("vm1"), - // PolicyFriendlyName: to.Ptr("protectionprofile1"), - // PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryProtectionContainerFriendlyName: to.Ptr("cloud1"), - // ProtectableItemID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectableItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // ProtectedItemType: to.Ptr("HyperVVirtualMachine"), - // ProtectionState: to.Ptr("Protected"), - // ProtectionStateDescription: to.Ptr("Protected"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.HyperVReplicaAzureReplicationDetails{ - // InstanceType: to.Ptr("HyperVReplicaAzure"), - // }, - // RecoveryContainerID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/d49858f157601230a6ac5862fbbc6e63bf38d23ecd96cf953767945d457fe9d5/replicationProtectionContainers/d38048d4-b460-4791-8ece-108395ee8478"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // RecoveryProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryServicesProviderID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/241641e6-ee7b-4ee4-8141-821fadda43fa"), - // ReplicationHealth: to.Ptr("Normal"), - // TestFailoverState: to.Ptr("None"), - // TestFailoverStateDescription: to.Ptr("None"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectioncontainermappings_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectioncontainermappings_client.go index 34d429d63661..2aacad5502f0 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectioncontainermappings_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectioncontainermappings_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -47,7 +46,7 @@ func NewReplicationProtectionContainerMappingsClient(subscriptionID string, cred // BeginCreate - The operation to create a protection container mapping. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -62,7 +61,8 @@ func (client *ReplicationProtectionContainerMappingsClient) BeginCreate(ctx cont if err != nil { return nil, err } - return runtime.NewPoller[ReplicationProtectionContainerMappingsClientCreateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationProtectionContainerMappingsClientCreateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectionContainerMappingsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ func (client *ReplicationProtectionContainerMappingsClient) BeginCreate(ctx cont // Create - The operation to create a protection container mapping. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectionContainerMappingsClient) create(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, mappingName string, creationInput CreateProtectionContainerMappingInput, options *ReplicationProtectionContainerMappingsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, creationInput, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -119,16 +121,19 @@ func (client *ReplicationProtectionContainerMappingsClient) createCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, creationInput) + if err := runtime.MarshalAsJSON(req, creationInput); err != nil { + return nil, err + } + return req, nil } // BeginDelete - The operation to delete or remove a protection container mapping. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -143,7 +148,8 @@ func (client *ReplicationProtectionContainerMappingsClient) BeginDelete(ctx cont if err != nil { return nil, err } - return runtime.NewPoller[ReplicationProtectionContainerMappingsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationProtectionContainerMappingsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectionContainerMappingsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -152,20 +158,22 @@ func (client *ReplicationProtectionContainerMappingsClient) BeginDelete(ctx cont // Delete - The operation to delete or remove a protection container mapping. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectionContainerMappingsClient) deleteOperation(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, mappingName string, removalInput RemoveProtectionContainerMappingInput, options *ReplicationProtectionContainerMappingsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, removalInput, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -200,15 +208,18 @@ func (client *ReplicationProtectionContainerMappingsClient) deleteCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() - return req, runtime.MarshalAsJSON(req, removalInput) + if err := runtime.MarshalAsJSON(req, removalInput); err != nil { + return nil, err + } + return req, nil } // Get - Gets the details of a protection container mapping. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -217,18 +228,21 @@ func (client *ReplicationProtectionContainerMappingsClient) deleteCreateRequest( // - options - ReplicationProtectionContainerMappingsClientGetOptions contains the optional parameters for the ReplicationProtectionContainerMappingsClient.Get // method. func (client *ReplicationProtectionContainerMappingsClient) Get(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, mappingName string, options *ReplicationProtectionContainerMappingsClientGetOptions) (ReplicationProtectionContainerMappingsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, options) if err != nil { return ReplicationProtectionContainerMappingsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationProtectionContainerMappingsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationProtectionContainerMappingsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationProtectionContainerMappingsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -263,7 +277,7 @@ func (client *ReplicationProtectionContainerMappingsClient) getCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,7 +294,7 @@ func (client *ReplicationProtectionContainerMappingsClient) getHandleResponse(re // NewListPager - Lists the protection container mappings in the vault. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ReplicationProtectionContainerMappingsClientListOptions contains the optional parameters for the ReplicationProtectionContainerMappingsClient.NewListPager @@ -333,7 +347,7 @@ func (client *ReplicationProtectionContainerMappingsClient) listCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -350,7 +364,7 @@ func (client *ReplicationProtectionContainerMappingsClient) listHandleResponse(r // NewListByReplicationProtectionContainersPager - Lists the protection container mappings for a protection container. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -413,7 +427,7 @@ func (client *ReplicationProtectionContainerMappingsClient) listByReplicationPro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -431,7 +445,7 @@ func (client *ReplicationProtectionContainerMappingsClient) listByReplicationPro // BeginPurge - The operation to purge(force delete) a protection container mapping. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -445,7 +459,8 @@ func (client *ReplicationProtectionContainerMappingsClient) BeginPurge(ctx conte if err != nil { return nil, err } - return runtime.NewPoller[ReplicationProtectionContainerMappingsClientPurgeResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationProtectionContainerMappingsClientPurgeResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectionContainerMappingsClientPurgeResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -454,20 +469,22 @@ func (client *ReplicationProtectionContainerMappingsClient) BeginPurge(ctx conte // Purge - The operation to purge(force delete) a protection container mapping. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectionContainerMappingsClient) purge(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, mappingName string, options *ReplicationProtectionContainerMappingsClientBeginPurgeOptions) (*http.Response, error) { + var err error req, err := client.purgeCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // purgeCreateRequest creates the Purge request. @@ -502,7 +519,7 @@ func (client *ReplicationProtectionContainerMappingsClient) purgeCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -510,7 +527,7 @@ func (client *ReplicationProtectionContainerMappingsClient) purgeCreateRequest(c // BeginUpdate - The operation to update protection container mapping. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -525,7 +542,8 @@ func (client *ReplicationProtectionContainerMappingsClient) BeginUpdate(ctx cont if err != nil { return nil, err } - return runtime.NewPoller[ReplicationProtectionContainerMappingsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationProtectionContainerMappingsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectionContainerMappingsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -534,20 +552,22 @@ func (client *ReplicationProtectionContainerMappingsClient) BeginUpdate(ctx cont // Update - The operation to update protection container mapping. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectionContainerMappingsClient) update(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, mappingName string, updateInput UpdateProtectionContainerMappingInput, options *ReplicationProtectionContainerMappingsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, updateInput, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -582,8 +602,11 @@ func (client *ReplicationProtectionContainerMappingsClient) updateCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, updateInput) + if err := runtime.MarshalAsJSON(req, updateInput); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectioncontainermappings_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectioncontainermappings_client_example_test.go deleted file mode 100644 index e04c9773469b..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectioncontainermappings_client_example_test.go +++ /dev/null @@ -1,302 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_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/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_ListByReplicationProtectionContainers.json -func ExampleReplicationProtectionContainerMappingsClient_NewListByReplicationProtectionContainersPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationProtectionContainerMappingsClient().NewListByReplicationProtectionContainersPager("vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ProtectionContainerMappingCollection = armrecoveryservicessiterecovery.ProtectionContainerMappingCollection{ - // Value: []*armrecoveryservicessiterecovery.ProtectionContainerMapping{ - // { - // Name: to.Ptr("cloud1protectionprofile1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectionContainerMappings"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectionContainerMappings/cloud1protectionprofile1"), - // Properties: &armrecoveryservicessiterecovery.ProtectionContainerMappingProperties{ - // Health: to.Ptr("Normal"), - // HealthErrorDetails: []*armrecoveryservicessiterecovery.HealthError{ - // }, - // PolicyFriendlyName: to.Ptr("protectionprofile1"), - // PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - // SourceFabricFriendlyName: to.Ptr("cloud1"), - // SourceProtectionContainerFriendlyName: to.Ptr("cloud1"), - // State: to.Ptr("Paired"), - // TargetFabricFriendlyName: to.Ptr("Microsoft Azure"), - // TargetProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"), - // TargetProtectionContainerID: to.Ptr("Microsoft Azure"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Get.json -func ExampleReplicationProtectionContainerMappingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationProtectionContainerMappingsClient().Get(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "cloud1protectionprofile1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectionContainerMapping = armrecoveryservicessiterecovery.ProtectionContainerMapping{ - // Name: to.Ptr("cloud1protectionprofile1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectionContainerMappings"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectionContainerMappings/cloud1protectionprofile1"), - // Properties: &armrecoveryservicessiterecovery.ProtectionContainerMappingProperties{ - // Health: to.Ptr("Normal"), - // HealthErrorDetails: []*armrecoveryservicessiterecovery.HealthError{ - // }, - // PolicyFriendlyName: to.Ptr("protectionprofile1"), - // PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - // SourceFabricFriendlyName: to.Ptr("cloud1"), - // SourceProtectionContainerFriendlyName: to.Ptr("cloud1"), - // State: to.Ptr("Paired"), - // TargetFabricFriendlyName: to.Ptr("Microsoft Azure"), - // TargetProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"), - // TargetProtectionContainerID: to.Ptr("Microsoft Azure"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Create.json -func ExampleReplicationProtectionContainerMappingsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectionContainerMappingsClient().BeginCreate(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "cloud1protectionprofile1", armrecoveryservicessiterecovery.CreateProtectionContainerMappingInput{ - Properties: &armrecoveryservicessiterecovery.CreateProtectionContainerMappingInputProperties{ - PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - ProviderSpecificInput: &armrecoveryservicessiterecovery.ReplicationProviderSpecificContainerMappingInput{ - InstanceType: to.Ptr("ReplicationProviderSpecificContainerMappingInput"), - }, - TargetProtectionContainerID: to.Ptr("Microsoft Azure"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectionContainerMapping = armrecoveryservicessiterecovery.ProtectionContainerMapping{ - // Name: to.Ptr("cloud1protectionprofile1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectionContainerMappings"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectionContainerMappings/cloud1protectionprofile1"), - // Properties: &armrecoveryservicessiterecovery.ProtectionContainerMappingProperties{ - // Health: to.Ptr("Normal"), - // HealthErrorDetails: []*armrecoveryservicessiterecovery.HealthError{ - // }, - // PolicyFriendlyName: to.Ptr("protectionprofile1"), - // PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - // SourceFabricFriendlyName: to.Ptr("cloud1"), - // SourceProtectionContainerFriendlyName: to.Ptr("cloud1"), - // State: to.Ptr("Paired"), - // TargetFabricFriendlyName: to.Ptr("Microsoft Azure"), - // TargetProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"), - // TargetProtectionContainerID: to.Ptr("Microsoft Azure"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Purge.json -func ExampleReplicationProtectionContainerMappingsClient_BeginPurge() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectionContainerMappingsClient().BeginPurge(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "cloud1protectionprofile1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Update.json -func ExampleReplicationProtectionContainerMappingsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectionContainerMappingsClient().BeginUpdate(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "cloud1protectionprofile1", armrecoveryservicessiterecovery.UpdateProtectionContainerMappingInput{ - Properties: &armrecoveryservicessiterecovery.UpdateProtectionContainerMappingInputProperties{ - ProviderSpecificInput: &armrecoveryservicessiterecovery.A2AUpdateContainerMappingInput{ - InstanceType: to.Ptr("A2A"), - AgentAutoUpdateStatus: to.Ptr(armrecoveryservicessiterecovery.AgentAutoUpdateStatusEnabled), - AutomationAccountArmID: to.Ptr("/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/automationrg1/providers/Microsoft.Automation/automationAccounts/automationaccount1"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectionContainerMapping = armrecoveryservicessiterecovery.ProtectionContainerMapping{ - // Name: to.Ptr("cloud1protectionprofile1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectionContainerMappings"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectionContainerMappings/cloud1protectionprofile1"), - // Properties: &armrecoveryservicessiterecovery.ProtectionContainerMappingProperties{ - // Health: to.Ptr("Normal"), - // HealthErrorDetails: []*armrecoveryservicessiterecovery.HealthError{ - // }, - // PolicyFriendlyName: to.Ptr("protectionprofile1"), - // PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.A2AProtectionContainerMappingDetails{ - // InstanceType: to.Ptr("A2A"), - // AgentAutoUpdateStatus: to.Ptr(armrecoveryservicessiterecovery.AgentAutoUpdateStatusEnabled), - // AutomationAccountArmID: to.Ptr("/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/automationrg1/providers/Microsoft.Automation/automationAccounts/automationaccount1"), - // JobScheduleName: to.Ptr("ffd503ec-5f88-4b58-97c8-841466e7aa47"), - // ScheduleName: to.Ptr("cloud1protectionprofile1_a85ea38f-62a8-471b-93cc-69b74fd9578c"), - // }, - // SourceFabricFriendlyName: to.Ptr("cloud1"), - // SourceProtectionContainerFriendlyName: to.Ptr("cloud1"), - // State: to.Ptr("Paired"), - // TargetFabricFriendlyName: to.Ptr("Microsoft Azure"), - // TargetProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"), - // TargetProtectionContainerID: to.Ptr("Microsoft Azure"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Delete.json -func ExampleReplicationProtectionContainerMappingsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectionContainerMappingsClient().BeginDelete(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "cloud1protectionprofile1", armrecoveryservicessiterecovery.RemoveProtectionContainerMappingInput{ - Properties: &armrecoveryservicessiterecovery.RemoveProtectionContainerMappingInputProperties{ - ProviderSpecificInput: &armrecoveryservicessiterecovery.ReplicationProviderContainerUnmappingInput{}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_List.json -func ExampleReplicationProtectionContainerMappingsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationProtectionContainerMappingsClient().NewListPager("vault1", "resourceGroupPS1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ProtectionContainerMappingCollection = armrecoveryservicessiterecovery.ProtectionContainerMappingCollection{ - // Value: []*armrecoveryservicessiterecovery.ProtectionContainerMapping{ - // { - // Name: to.Ptr("cloud1protectionprofile1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationProtectionContainerMappings"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectionContainerMappings/cloud1protectionprofile1"), - // Properties: &armrecoveryservicessiterecovery.ProtectionContainerMappingProperties{ - // Health: to.Ptr("Normal"), - // HealthErrorDetails: []*armrecoveryservicessiterecovery.HealthError{ - // }, - // PolicyFriendlyName: to.Ptr("protectionprofile1"), - // PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"), - // SourceFabricFriendlyName: to.Ptr("cloud1"), - // SourceProtectionContainerFriendlyName: to.Ptr("cloud1"), - // State: to.Ptr("Paired"), - // TargetFabricFriendlyName: to.Ptr("Microsoft Azure"), - // TargetProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"), - // TargetProtectionContainerID: to.Ptr("Microsoft Azure"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectioncontainers_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectioncontainers_client.go index 6ba1902face0..90e619504e36 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectioncontainers_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectioncontainers_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -47,7 +46,7 @@ func NewReplicationProtectionContainersClient(subscriptionID string, credential // BeginCreate - Operation to create a protection container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Unique fabric ARM name. @@ -61,7 +60,8 @@ func (client *ReplicationProtectionContainersClient) BeginCreate(ctx context.Con if err != nil { return nil, err } - return runtime.NewPoller[ReplicationProtectionContainersClientCreateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationProtectionContainersClientCreateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectionContainersClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,20 +70,22 @@ func (client *ReplicationProtectionContainersClient) BeginCreate(ctx context.Con // Create - Operation to create a protection container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectionContainersClient) create(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, creationInput CreateProtectionContainerInput, options *ReplicationProtectionContainersClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, creationInput, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -114,16 +116,19 @@ func (client *ReplicationProtectionContainersClient) createCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, creationInput) + if err := runtime.MarshalAsJSON(req, creationInput); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Operation to remove a protection container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Unique fabric ARM name. @@ -136,7 +141,8 @@ func (client *ReplicationProtectionContainersClient) BeginDelete(ctx context.Con if err != nil { return nil, err } - return runtime.NewPoller[ReplicationProtectionContainersClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationProtectionContainersClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectionContainersClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -145,20 +151,22 @@ func (client *ReplicationProtectionContainersClient) BeginDelete(ctx context.Con // Delete - Operation to remove a protection container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectionContainersClient) deleteOperation(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, options *ReplicationProtectionContainersClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -189,7 +197,7 @@ func (client *ReplicationProtectionContainersClient) deleteCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -197,7 +205,7 @@ func (client *ReplicationProtectionContainersClient) deleteCreateRequest(ctx con // BeginDiscoverProtectableItem - The operation to a add a protectable item to a protection container(Add physical server). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - The name of the fabric. @@ -211,7 +219,8 @@ func (client *ReplicationProtectionContainersClient) BeginDiscoverProtectableIte if err != nil { return nil, err } - return runtime.NewPoller[ReplicationProtectionContainersClientDiscoverProtectableItemResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationProtectionContainersClientDiscoverProtectableItemResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectionContainersClientDiscoverProtectableItemResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -220,20 +229,22 @@ func (client *ReplicationProtectionContainersClient) BeginDiscoverProtectableIte // DiscoverProtectableItem - The operation to a add a protectable item to a protection container(Add physical server). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectionContainersClient) discoverProtectableItem(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, discoverProtectableItemRequest DiscoverProtectableItemRequest, options *ReplicationProtectionContainersClientBeginDiscoverProtectableItemOptions) (*http.Response, error) { + var err error req, err := client.discoverProtectableItemCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, discoverProtectableItemRequest, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // discoverProtectableItemCreateRequest creates the DiscoverProtectableItem request. @@ -264,16 +275,19 @@ func (client *ReplicationProtectionContainersClient) discoverProtectableItemCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, discoverProtectableItemRequest) + if err := runtime.MarshalAsJSON(req, discoverProtectableItemRequest); err != nil { + return nil, err + } + return req, nil } // Get - Gets the details of a protection container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -281,18 +295,21 @@ func (client *ReplicationProtectionContainersClient) discoverProtectableItemCrea // - options - ReplicationProtectionContainersClientGetOptions contains the optional parameters for the ReplicationProtectionContainersClient.Get // method. func (client *ReplicationProtectionContainersClient) Get(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, options *ReplicationProtectionContainersClientGetOptions) (ReplicationProtectionContainersClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, options) if err != nil { return ReplicationProtectionContainersClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationProtectionContainersClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationProtectionContainersClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationProtectionContainersClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -323,7 +340,7 @@ func (client *ReplicationProtectionContainersClient) getCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -340,7 +357,7 @@ func (client *ReplicationProtectionContainersClient) getHandleResponse(resp *htt // NewListPager - Lists the protection containers in a vault. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ReplicationProtectionContainersClientListOptions contains the optional parameters for the ReplicationProtectionContainersClient.NewListPager @@ -393,7 +410,7 @@ func (client *ReplicationProtectionContainersClient) listCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -410,7 +427,7 @@ func (client *ReplicationProtectionContainersClient) listHandleResponse(resp *ht // NewListByReplicationFabricsPager - Lists the protection containers in the specified fabric. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -468,7 +485,7 @@ func (client *ReplicationProtectionContainersClient) listByReplicationFabricsCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -486,7 +503,7 @@ func (client *ReplicationProtectionContainersClient) listByReplicationFabricsHan // BeginSwitchProtection - Operation to switch protection from one container to another or one replication provider to another. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Unique fabric name. @@ -500,7 +517,8 @@ func (client *ReplicationProtectionContainersClient) BeginSwitchProtection(ctx c if err != nil { return nil, err } - return runtime.NewPoller[ReplicationProtectionContainersClientSwitchProtectionResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationProtectionContainersClientSwitchProtectionResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationProtectionContainersClientSwitchProtectionResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -509,20 +527,22 @@ func (client *ReplicationProtectionContainersClient) BeginSwitchProtection(ctx c // SwitchProtection - Operation to switch protection from one container to another or one replication provider to another. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationProtectionContainersClient) switchProtection(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, switchInput SwitchProtectionInput, options *ReplicationProtectionContainersClientBeginSwitchProtectionOptions) (*http.Response, error) { + var err error req, err := client.switchProtectionCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, switchInput, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // switchProtectionCreateRequest creates the SwitchProtection request. @@ -553,8 +573,11 @@ func (client *ReplicationProtectionContainersClient) switchProtectionCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, switchInput) + if err := runtime.MarshalAsJSON(req, switchInput); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectioncontainers_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectioncontainers_client_example_test.go deleted file mode 100644 index 692645f52a40..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectioncontainers_client_example_test.go +++ /dev/null @@ -1,285 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_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/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_ListByReplicationFabrics.json -func ExampleReplicationProtectionContainersClient_NewListByReplicationFabricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationProtectionContainersClient().NewListByReplicationFabricsPager("vault1", "resourceGroupPS1", "cloud1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ProtectionContainerCollection = armrecoveryservicessiterecovery.ProtectionContainerCollection{ - // Value: []*armrecoveryservicessiterecovery.ProtectionContainer{ - // { - // Name: to.Ptr("cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"), - // Properties: &armrecoveryservicessiterecovery.ProtectionContainerProperties{ - // FabricFriendlyName: to.Ptr("cloud1"), - // FabricType: to.Ptr("HyperVSite"), - // FriendlyName: to.Ptr("cloud1"), - // PairingStatus: to.Ptr("NotPaired"), - // ProtectedItemCount: to.Ptr[int32](0), - // Role: to.Ptr(""), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_Get.json -func ExampleReplicationProtectionContainersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationProtectionContainersClient().Get(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectionContainer = armrecoveryservicessiterecovery.ProtectionContainer{ - // Name: to.Ptr("cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"), - // Properties: &armrecoveryservicessiterecovery.ProtectionContainerProperties{ - // FabricFriendlyName: to.Ptr("cloud1"), - // FabricType: to.Ptr("HyperVSite"), - // FriendlyName: to.Ptr("cloud1"), - // PairingStatus: to.Ptr("NotPaired"), - // ProtectedItemCount: to.Ptr[int32](0), - // Role: to.Ptr(""), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_Create.json -func ExampleReplicationProtectionContainersClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectionContainersClient().BeginCreate(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", armrecoveryservicessiterecovery.CreateProtectionContainerInput{ - Properties: &armrecoveryservicessiterecovery.CreateProtectionContainerInputProperties{ - ProviderSpecificInput: []armrecoveryservicessiterecovery.ReplicationProviderSpecificContainerCreationInputClassification{ - &armrecoveryservicessiterecovery.ReplicationProviderSpecificContainerCreationInput{ - InstanceType: to.Ptr("ReplicationProviderSpecificContainerCreationInput"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectionContainer = armrecoveryservicessiterecovery.ProtectionContainer{ - // Name: to.Ptr("cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"), - // Properties: &armrecoveryservicessiterecovery.ProtectionContainerProperties{ - // FabricFriendlyName: to.Ptr("cloud1"), - // FabricType: to.Ptr("HyperVSite"), - // FriendlyName: to.Ptr("cloud1"), - // PairingStatus: to.Ptr("NotPaired"), - // ProtectedItemCount: to.Ptr[int32](0), - // Role: to.Ptr(""), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_DiscoverProtectableItem.json -func ExampleReplicationProtectionContainersClient_BeginDiscoverProtectableItem() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectionContainersClient().BeginDiscoverProtectableItem(ctx, "MadhaviVault", "MadhaviVRG", "V2A-W2K12-660", "cloud_7328549c-5c37-4459-a3c2-e35f9ef6893c", armrecoveryservicessiterecovery.DiscoverProtectableItemRequest{ - Properties: &armrecoveryservicessiterecovery.DiscoverProtectableItemRequestProperties{ - FriendlyName: to.Ptr("Test"), - IPAddress: to.Ptr("10.150.2.3"), - OSType: to.Ptr("Windows"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectionContainer = armrecoveryservicessiterecovery.ProtectionContainer{ - // Name: to.Ptr("cloud_7328549c-5c37-4459-a3c2-e35f9ef6893c"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers"), - // ID: to.Ptr("/Subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/MadhaviVRG/providers/Microsoft.RecoveryServices/vaults/MadhaviVault/replicationFabrics/239f778f368e34f78216d81f030725cdf2033174b47879b9f2eeede06fdd9c4d/replicationProtectionContainers/cloud_7328549c-5c37-4459-a3c2-e35f9ef6893c"), - // Properties: &armrecoveryservicessiterecovery.ProtectionContainerProperties{ - // FabricFriendlyName: to.Ptr("V2A-W2K12-660"), - // FabricType: to.Ptr("VMware"), - // FriendlyName: to.Ptr("V2A-W2K12-660"), - // PairingStatus: to.Ptr("Paired"), - // ProtectedItemCount: to.Ptr[int32](2), - // Role: to.Ptr("Primary"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_Delete.json -func ExampleReplicationProtectionContainersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectionContainersClient().BeginDelete(ctx, "vault1", "resourceGroupPS1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_SwitchProtection.json -func ExampleReplicationProtectionContainersClient_BeginSwitchProtection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationProtectionContainersClient().BeginSwitchProtection(ctx, "priyanponeboxvault", "priyanprg", "CentralUSCanSite", "CentralUSCancloud", armrecoveryservicessiterecovery.SwitchProtectionInput{ - Properties: &armrecoveryservicessiterecovery.SwitchProtectionInputProperties{ - ProviderSpecificDetails: &armrecoveryservicessiterecovery.A2ASwitchProtectionInput{ - InstanceType: to.Ptr("A2A"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectionContainer = armrecoveryservicessiterecovery.ProtectionContainer{ - // Name: to.Ptr("euscancloud"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers"), - // ID: to.Ptr("/Subscriptions/42195872-7e70-4f8a-837f-84b28ecbb78b/resourceGroups/priyanprg/providers/Microsoft.RecoveryServices/vaults/priyanponeboxvault/replicationFabrics/EUSCanSite/replicationProtectionContainers/euscancloud"), - // Properties: &armrecoveryservicessiterecovery.ProtectionContainerProperties{ - // FabricFriendlyName: to.Ptr("East US 2 EUAP"), - // FabricType: to.Ptr("Azure"), - // FriendlyName: to.Ptr("euscancloud"), - // PairingStatus: to.Ptr("Paired"), - // ProtectedItemCount: to.Ptr[int32](0), - // Role: to.Ptr("Primary"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_List.json -func ExampleReplicationProtectionContainersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationProtectionContainersClient().NewListPager("vault1", "resourceGroupPS1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ProtectionContainerCollection = armrecoveryservicessiterecovery.ProtectionContainerCollection{ - // Value: []*armrecoveryservicessiterecovery.ProtectionContainer{ - // { - // Name: to.Ptr("cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationProtectionContainers"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"), - // Properties: &armrecoveryservicessiterecovery.ProtectionContainerProperties{ - // FabricFriendlyName: to.Ptr("cloud1"), - // FabricType: to.Ptr("HyperVSite"), - // FriendlyName: to.Ptr("cloud1"), - // PairingStatus: to.Ptr("NotPaired"), - // ProtectedItemCount: to.Ptr[int32](0), - // Role: to.Ptr(""), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectionintents_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectionintents_client.go index 2ff0eeb70f7b..1f07d7d6e56c 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectionintents_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectionintents_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -47,7 +46,7 @@ func NewReplicationProtectionIntentsClient(subscriptionID string, credential azc // Create - The operation to create an ASR replication protection intent item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - intentObjectName - A name for the replication protection item. @@ -55,18 +54,21 @@ func NewReplicationProtectionIntentsClient(subscriptionID string, credential azc // - options - ReplicationProtectionIntentsClientCreateOptions contains the optional parameters for the ReplicationProtectionIntentsClient.Create // method. func (client *ReplicationProtectionIntentsClient) Create(ctx context.Context, resourceName string, resourceGroupName string, intentObjectName string, input CreateProtectionIntentInput, options *ReplicationProtectionIntentsClientCreateOptions) (ReplicationProtectionIntentsClientCreateResponse, error) { + var err error req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, intentObjectName, input, options) if err != nil { return ReplicationProtectionIntentsClientCreateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationProtectionIntentsClientCreateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationProtectionIntentsClientCreateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationProtectionIntentsClientCreateResponse{}, err } - return client.createHandleResponse(resp) + resp, err := client.createHandleResponse(httpResp) + return resp, err } // createCreateRequest creates the Create request. @@ -93,10 +95,13 @@ func (client *ReplicationProtectionIntentsClient) createCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, input) + if err := runtime.MarshalAsJSON(req, input); err != nil { + return nil, err + } + return req, nil } // createHandleResponse handles the Create response. @@ -111,25 +116,28 @@ func (client *ReplicationProtectionIntentsClient) createHandleResponse(resp *htt // Get - Gets the details of an ASR replication protection intent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - intentObjectName - Replication protection intent name. // - options - ReplicationProtectionIntentsClientGetOptions contains the optional parameters for the ReplicationProtectionIntentsClient.Get // method. func (client *ReplicationProtectionIntentsClient) Get(ctx context.Context, resourceName string, resourceGroupName string, intentObjectName string, options *ReplicationProtectionIntentsClientGetOptions) (ReplicationProtectionIntentsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, intentObjectName, options) if err != nil { return ReplicationProtectionIntentsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationProtectionIntentsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationProtectionIntentsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationProtectionIntentsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -156,7 +164,7 @@ func (client *ReplicationProtectionIntentsClient) getCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -173,7 +181,7 @@ func (client *ReplicationProtectionIntentsClient) getHandleResponse(resp *http.R // NewListPager - Gets the list of ASR replication protection intent objects in the vault. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ReplicationProtectionIntentsClientListOptions contains the optional parameters for the ReplicationProtectionIntentsClient.NewListPager @@ -226,7 +234,7 @@ func (client *ReplicationProtectionIntentsClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") if options != nil && options.SkipToken != nil { reqQP.Set("skipToken", *options.SkipToken) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectionintents_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectionintents_client_example_test.go deleted file mode 100644 index 975a748436f1..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectionintents_client_example_test.go +++ /dev/null @@ -1,151 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_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/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionIntents_List.json -func ExampleReplicationProtectionIntentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationProtectionIntentsClient().NewListPager("2007vttp", "resourceGroupPS1", &armrecoveryservicessiterecovery.ReplicationProtectionIntentsClientListOptions{SkipToken: nil, - TakeToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ReplicationProtectionIntentCollection = armrecoveryservicessiterecovery.ReplicationProtectionIntentCollection{ - // Value: []*armrecoveryservicessiterecovery.ReplicationProtectionIntent{ - // { - // Name: to.Ptr("vm1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationProtectionIntents"), - // ID: to.Ptr("/Subscriptions/509099b2-9d2c-4636-b43e-bd5cafb6be69/resourceGroups/2007vttp/providers/Microsoft.RecoveryServices/vaults/tp2007vt/replicationProtectionIntents/vm1"), - // Properties: &armrecoveryservicessiterecovery.ReplicationProtectionIntentProperties{ - // FriendlyName: to.Ptr("vm1"), - // JobID: to.Ptr("/Subscriptions/d90d145a-4cdd-45a3-b2c4-971d69775278/resourceGroups/a2acl-rg-vault-prod-gip-ccy/providers/Microsoft.RecoveryServices/vaults/a2acl-vault-prod-gip-ccy/replicationJobs/02004ea7-d498-4bb4-bdeb-cdb611706867"), - // JobState: to.Ptr("InProgress"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.A2AReplicationIntentDetails{ - // InstanceType: to.Ptr("A2A"), - // FabricObjectID: to.Ptr("/subscriptions/509099b2-9d2c-4636-b43e-bd5cafb6be69/resourceGroups/removeOne/providers/Microsoft.Compute/virtualMachines/vmPpgAv5"), - // PrimaryLocation: to.Ptr("eastUs2"), - // RecoveryAvailabilityType: to.Ptr("Single"), - // RecoveryLocation: to.Ptr("westus2"), - // RecoverySubscriptionID: to.Ptr("ed5bcdf6-d61e-47bd-8ea9-f2bd379a2640"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionIntents_Get.json -func ExampleReplicationProtectionIntentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationProtectionIntentsClient().Get(ctx, "vault1", "resourceGroupPS1", "vm1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationProtectionIntent = armrecoveryservicessiterecovery.ReplicationProtectionIntent{ - // Name: to.Ptr("vm1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationProtectionIntents"), - // ID: to.Ptr("/Subscriptions/509099b2-9d2c-4636-b43e-bd5cafb6be69/resourceGroups/2007vttp/providers/Microsoft.RecoveryServices/vaults/tp2007vt/replicationProtectionIntents/vm1"), - // Properties: &armrecoveryservicessiterecovery.ReplicationProtectionIntentProperties{ - // FriendlyName: to.Ptr("vm1"), - // JobID: to.Ptr("/Subscriptions/d90d145a-4cdd-45a3-b2c4-971d69775278/resourceGroups/a2acl-rg-vault-prod-gip-ccy/providers/Microsoft.RecoveryServices/vaults/a2acl-vault-prod-gip-ccy/replicationJobs/02004ea7-d498-4bb4-bdeb-cdb611706867"), - // JobState: to.Ptr("InProgress"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.A2AReplicationIntentDetails{ - // InstanceType: to.Ptr("A2A"), - // FabricObjectID: to.Ptr("/subscriptions/509099b2-9d2c-4636-b43e-bd5cafb6be69/resourceGroups/removeOne/providers/Microsoft.Compute/virtualMachines/vmPpgAv5"), - // PrimaryLocation: to.Ptr("eastUs2"), - // RecoveryAvailabilityType: to.Ptr("Single"), - // RecoveryLocation: to.Ptr("westus2"), - // RecoverySubscriptionID: to.Ptr("ed5bcdf6-d61e-47bd-8ea9-f2bd379a2640"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionIntents_Create.json -func ExampleReplicationProtectionIntentsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationProtectionIntentsClient().Create(ctx, "vault1", "resourceGroupPS1", "vm1", armrecoveryservicessiterecovery.CreateProtectionIntentInput{ - Properties: &armrecoveryservicessiterecovery.CreateProtectionIntentProperties{ - ProviderSpecificDetails: &armrecoveryservicessiterecovery.A2ACreateProtectionIntentInput{ - InstanceType: to.Ptr("A2A"), - FabricObjectID: to.Ptr("/subscriptions/509099b2-9d2c-4636-b43e-bd5cafb6be69/resourceGroups/removeOne/providers/Microsoft.Compute/virtualMachines/vmPpgAv5"), - PrimaryLocation: to.Ptr("eastUs2"), - RecoveryAvailabilityType: to.Ptr(armrecoveryservicessiterecovery.A2ARecoveryAvailabilityTypeSingle), - RecoveryLocation: to.Ptr("westus2"), - RecoveryResourceGroupID: to.Ptr("/subscriptions/509099b2-9d2c-4636-b43e-bd5cafb6be69/resourceGroups/removeOne-asr"), - RecoverySubscriptionID: to.Ptr("ed5bcdf6-d61e-47bd-8ea9-f2bd379a2640"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationProtectionIntent = armrecoveryservicessiterecovery.ReplicationProtectionIntent{ - // Name: to.Ptr("vm1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationProtectionIntents"), - // ID: to.Ptr("/Subscriptions/509099b2-9d2c-4636-b43e-bd5cafb6be69/resourceGroups/2007vttp/providers/Microsoft.RecoveryServices/vaults/tp2007vt/replicationProtectionIntents/vm1"), - // Properties: &armrecoveryservicessiterecovery.ReplicationProtectionIntentProperties{ - // FriendlyName: to.Ptr("vm1"), - // JobID: to.Ptr("/Subscriptions/d90d145a-4cdd-45a3-b2c4-971d69775278/resourceGroups/a2acl-rg-vault-prod-gip-ccy/providers/Microsoft.RecoveryServices/vaults/a2acl-vault-prod-gip-ccy/replicationJobs/02004ea7-d498-4bb4-bdeb-cdb611706867"), - // JobState: to.Ptr("InProgress"), - // ProviderSpecificDetails: &armrecoveryservicessiterecovery.A2AReplicationIntentDetails{ - // InstanceType: to.Ptr("A2A"), - // RecoveryAvailabilityType: to.Ptr("Single"), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationrecoveryplans_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationrecoveryplans_client.go index 88a9175e4e14..9fe762f2ed3c 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationrecoveryplans_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationrecoveryplans_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -47,7 +46,7 @@ func NewReplicationRecoveryPlansClient(subscriptionID string, credential azcore. // BeginCreate - The operation to create a recovery plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - recoveryPlanName - Recovery plan name. @@ -60,7 +59,8 @@ func (client *ReplicationRecoveryPlansClient) BeginCreate(ctx context.Context, r if err != nil { return nil, err } - return runtime.NewPoller[ReplicationRecoveryPlansClientCreateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationRecoveryPlansClientCreateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationRecoveryPlansClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -69,20 +69,22 @@ func (client *ReplicationRecoveryPlansClient) BeginCreate(ctx context.Context, r // Create - The operation to create a recovery plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationRecoveryPlansClient) create(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input CreateRecoveryPlanInput, options *ReplicationRecoveryPlansClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, recoveryPlanName, input, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -109,16 +111,19 @@ func (client *ReplicationRecoveryPlansClient) createCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, input) + if err := runtime.MarshalAsJSON(req, input); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete a recovery plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - recoveryPlanName - Recovery plan name. @@ -130,7 +135,8 @@ func (client *ReplicationRecoveryPlansClient) BeginDelete(ctx context.Context, r if err != nil { return nil, err } - return runtime.NewPoller[ReplicationRecoveryPlansClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationRecoveryPlansClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationRecoveryPlansClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -139,20 +145,22 @@ func (client *ReplicationRecoveryPlansClient) BeginDelete(ctx context.Context, r // Delete - Delete a recovery plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationRecoveryPlansClient) deleteOperation(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceName, resourceGroupName, recoveryPlanName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -179,7 +187,7 @@ func (client *ReplicationRecoveryPlansClient) deleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -187,7 +195,7 @@ func (client *ReplicationRecoveryPlansClient) deleteCreateRequest(ctx context.Co // BeginFailoverCancel - The operation to cancel the failover of a recovery plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - recoveryPlanName - Recovery plan name. @@ -199,7 +207,8 @@ func (client *ReplicationRecoveryPlansClient) BeginFailoverCancel(ctx context.Co if err != nil { return nil, err } - return runtime.NewPoller[ReplicationRecoveryPlansClientFailoverCancelResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationRecoveryPlansClientFailoverCancelResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationRecoveryPlansClientFailoverCancelResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -208,20 +217,22 @@ func (client *ReplicationRecoveryPlansClient) BeginFailoverCancel(ctx context.Co // FailoverCancel - The operation to cancel the failover of a recovery plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationRecoveryPlansClient) failoverCancel(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginFailoverCancelOptions) (*http.Response, error) { + var err error req, err := client.failoverCancelCreateRequest(ctx, resourceName, resourceGroupName, recoveryPlanName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // failoverCancelCreateRequest creates the FailoverCancel request. @@ -248,7 +259,7 @@ func (client *ReplicationRecoveryPlansClient) failoverCancelCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -257,7 +268,7 @@ func (client *ReplicationRecoveryPlansClient) failoverCancelCreateRequest(ctx co // BeginFailoverCommit - The operation to commit the failover of a recovery plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - recoveryPlanName - Recovery plan name. @@ -269,7 +280,8 @@ func (client *ReplicationRecoveryPlansClient) BeginFailoverCommit(ctx context.Co if err != nil { return nil, err } - return runtime.NewPoller[ReplicationRecoveryPlansClientFailoverCommitResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationRecoveryPlansClientFailoverCommitResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationRecoveryPlansClientFailoverCommitResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -278,20 +290,22 @@ func (client *ReplicationRecoveryPlansClient) BeginFailoverCommit(ctx context.Co // FailoverCommit - The operation to commit the failover of a recovery plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationRecoveryPlansClient) failoverCommit(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginFailoverCommitOptions) (*http.Response, error) { + var err error req, err := client.failoverCommitCreateRequest(ctx, resourceName, resourceGroupName, recoveryPlanName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // failoverCommitCreateRequest creates the FailoverCommit request. @@ -318,7 +332,7 @@ func (client *ReplicationRecoveryPlansClient) failoverCommitCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -327,25 +341,28 @@ func (client *ReplicationRecoveryPlansClient) failoverCommitCreateRequest(ctx co // Get - Gets the details of the recovery plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - recoveryPlanName - Name of the recovery plan. // - options - ReplicationRecoveryPlansClientGetOptions contains the optional parameters for the ReplicationRecoveryPlansClient.Get // method. func (client *ReplicationRecoveryPlansClient) Get(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientGetOptions) (ReplicationRecoveryPlansClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, recoveryPlanName, options) if err != nil { return ReplicationRecoveryPlansClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationRecoveryPlansClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationRecoveryPlansClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationRecoveryPlansClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -372,7 +389,7 @@ func (client *ReplicationRecoveryPlansClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -389,7 +406,7 @@ func (client *ReplicationRecoveryPlansClient) getHandleResponse(resp *http.Respo // NewListPager - Lists the recovery plans in the vault. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ReplicationRecoveryPlansClientListOptions contains the optional parameters for the ReplicationRecoveryPlansClient.NewListPager @@ -442,7 +459,7 @@ func (client *ReplicationRecoveryPlansClient) listCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -460,7 +477,7 @@ func (client *ReplicationRecoveryPlansClient) listHandleResponse(resp *http.Resp // BeginPlannedFailover - The operation to start the planned failover of a recovery plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - recoveryPlanName - Recovery plan name. @@ -473,7 +490,8 @@ func (client *ReplicationRecoveryPlansClient) BeginPlannedFailover(ctx context.C if err != nil { return nil, err } - return runtime.NewPoller[ReplicationRecoveryPlansClientPlannedFailoverResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationRecoveryPlansClientPlannedFailoverResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationRecoveryPlansClientPlannedFailoverResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -482,20 +500,22 @@ func (client *ReplicationRecoveryPlansClient) BeginPlannedFailover(ctx context.C // PlannedFailover - The operation to start the planned failover of a recovery plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationRecoveryPlansClient) plannedFailover(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input RecoveryPlanPlannedFailoverInput, options *ReplicationRecoveryPlansClientBeginPlannedFailoverOptions) (*http.Response, error) { + var err error req, err := client.plannedFailoverCreateRequest(ctx, resourceName, resourceGroupName, recoveryPlanName, input, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // plannedFailoverCreateRequest creates the PlannedFailover request. @@ -522,16 +542,19 @@ func (client *ReplicationRecoveryPlansClient) plannedFailoverCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, input) + if err := runtime.MarshalAsJSON(req, input); err != nil { + return nil, err + } + return req, nil } // BeginReprotect - The operation to reprotect(reverse replicate) a recovery plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - recoveryPlanName - Recovery plan name. @@ -543,7 +566,8 @@ func (client *ReplicationRecoveryPlansClient) BeginReprotect(ctx context.Context if err != nil { return nil, err } - return runtime.NewPoller[ReplicationRecoveryPlansClientReprotectResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationRecoveryPlansClientReprotectResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationRecoveryPlansClientReprotectResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -552,20 +576,22 @@ func (client *ReplicationRecoveryPlansClient) BeginReprotect(ctx context.Context // Reprotect - The operation to reprotect(reverse replicate) a recovery plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationRecoveryPlansClient) reprotect(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginReprotectOptions) (*http.Response, error) { + var err error req, err := client.reprotectCreateRequest(ctx, resourceName, resourceGroupName, recoveryPlanName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // reprotectCreateRequest creates the Reprotect request. @@ -592,7 +618,7 @@ func (client *ReplicationRecoveryPlansClient) reprotectCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -601,7 +627,7 @@ func (client *ReplicationRecoveryPlansClient) reprotectCreateRequest(ctx context // BeginTestFailover - The operation to start the test failover of a recovery plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - recoveryPlanName - Recovery plan name. @@ -614,7 +640,8 @@ func (client *ReplicationRecoveryPlansClient) BeginTestFailover(ctx context.Cont if err != nil { return nil, err } - return runtime.NewPoller[ReplicationRecoveryPlansClientTestFailoverResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationRecoveryPlansClientTestFailoverResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationRecoveryPlansClientTestFailoverResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -623,20 +650,22 @@ func (client *ReplicationRecoveryPlansClient) BeginTestFailover(ctx context.Cont // TestFailover - The operation to start the test failover of a recovery plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationRecoveryPlansClient) testFailover(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input RecoveryPlanTestFailoverInput, options *ReplicationRecoveryPlansClientBeginTestFailoverOptions) (*http.Response, error) { + var err error req, err := client.testFailoverCreateRequest(ctx, resourceName, resourceGroupName, recoveryPlanName, input, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // testFailoverCreateRequest creates the TestFailover request. @@ -663,16 +692,19 @@ func (client *ReplicationRecoveryPlansClient) testFailoverCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, input) + if err := runtime.MarshalAsJSON(req, input); err != nil { + return nil, err + } + return req, nil } // BeginTestFailoverCleanup - The operation to cleanup test failover of a recovery plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - recoveryPlanName - Recovery plan name. @@ -685,7 +717,8 @@ func (client *ReplicationRecoveryPlansClient) BeginTestFailoverCleanup(ctx conte if err != nil { return nil, err } - return runtime.NewPoller[ReplicationRecoveryPlansClientTestFailoverCleanupResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationRecoveryPlansClientTestFailoverCleanupResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationRecoveryPlansClientTestFailoverCleanupResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -694,20 +727,22 @@ func (client *ReplicationRecoveryPlansClient) BeginTestFailoverCleanup(ctx conte // TestFailoverCleanup - The operation to cleanup test failover of a recovery plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationRecoveryPlansClient) testFailoverCleanup(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input RecoveryPlanTestFailoverCleanupInput, options *ReplicationRecoveryPlansClientBeginTestFailoverCleanupOptions) (*http.Response, error) { + var err error req, err := client.testFailoverCleanupCreateRequest(ctx, resourceName, resourceGroupName, recoveryPlanName, input, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // testFailoverCleanupCreateRequest creates the TestFailoverCleanup request. @@ -734,16 +769,19 @@ func (client *ReplicationRecoveryPlansClient) testFailoverCleanupCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, input) + if err := runtime.MarshalAsJSON(req, input); err != nil { + return nil, err + } + return req, nil } // BeginUnplannedFailover - The operation to start the unplanned failover of a recovery plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - recoveryPlanName - Recovery plan name. @@ -756,7 +794,8 @@ func (client *ReplicationRecoveryPlansClient) BeginUnplannedFailover(ctx context if err != nil { return nil, err } - return runtime.NewPoller[ReplicationRecoveryPlansClientUnplannedFailoverResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationRecoveryPlansClientUnplannedFailoverResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationRecoveryPlansClientUnplannedFailoverResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -765,20 +804,22 @@ func (client *ReplicationRecoveryPlansClient) BeginUnplannedFailover(ctx context // UnplannedFailover - The operation to start the unplanned failover of a recovery plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationRecoveryPlansClient) unplannedFailover(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input RecoveryPlanUnplannedFailoverInput, options *ReplicationRecoveryPlansClientBeginUnplannedFailoverOptions) (*http.Response, error) { + var err error req, err := client.unplannedFailoverCreateRequest(ctx, resourceName, resourceGroupName, recoveryPlanName, input, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // unplannedFailoverCreateRequest creates the UnplannedFailover request. @@ -805,16 +846,19 @@ func (client *ReplicationRecoveryPlansClient) unplannedFailoverCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, input) + if err := runtime.MarshalAsJSON(req, input); err != nil { + return nil, err + } + return req, nil } // BeginUpdate - The operation to update a recovery plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - recoveryPlanName - Recovery plan name. @@ -827,7 +871,8 @@ func (client *ReplicationRecoveryPlansClient) BeginUpdate(ctx context.Context, r if err != nil { return nil, err } - return runtime.NewPoller[ReplicationRecoveryPlansClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationRecoveryPlansClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationRecoveryPlansClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -836,20 +881,22 @@ func (client *ReplicationRecoveryPlansClient) BeginUpdate(ctx context.Context, r // Update - The operation to update a recovery plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationRecoveryPlansClient) update(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input UpdateRecoveryPlanInput, options *ReplicationRecoveryPlansClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceName, resourceGroupName, recoveryPlanName, input, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -876,8 +923,11 @@ func (client *ReplicationRecoveryPlansClient) updateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, input) + if err := runtime.MarshalAsJSON(req, input); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationrecoveryplans_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationrecoveryplans_client_example_test.go deleted file mode 100644 index bb56d6d37e17..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationrecoveryplans_client_example_test.go +++ /dev/null @@ -1,1035 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_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/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_List.json -func ExampleReplicationRecoveryPlansClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationRecoveryPlansClient().NewListPager("vault1", "resourceGroupPS1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RecoveryPlanCollection = armrecoveryservicessiterecovery.RecoveryPlanCollection{ - // Value: []*armrecoveryservicessiterecovery.RecoveryPlan{ - // { - // Name: to.Ptr("RPtest1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationRecoveryPlans"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationRecoveryPlans/RPtest1"), - // Properties: &armrecoveryservicessiterecovery.RecoveryPlanProperties{ - // AllowedOperations: []*string{ - // to.Ptr("PlannedFailover"), - // to.Ptr("UnplannedFailover"), - // to.Ptr("TestFailover")}, - // FailoverDeploymentModel: to.Ptr("ResourceManager"), - // FriendlyName: to.Ptr("RPtest1"), - // Groups: []*armrecoveryservicessiterecovery.RecoveryPlanGroup{ - // }, - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryFabricID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // ReplicationProviders: []*string{ - // to.Ptr("HyperVReplicaAzure")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Get.json -func ExampleReplicationRecoveryPlansClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationRecoveryPlansClient().Get(ctx, "vault1", "resourceGroupPS1", "RPtest1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecoveryPlan = armrecoveryservicessiterecovery.RecoveryPlan{ - // Name: to.Ptr("RPtest1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationRecoveryPlans"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationRecoveryPlans/RPtest1"), - // Properties: &armrecoveryservicessiterecovery.RecoveryPlanProperties{ - // AllowedOperations: []*string{ - // to.Ptr("PlannedFailover"), - // to.Ptr("UnplannedFailover"), - // to.Ptr("TestFailover")}, - // FailoverDeploymentModel: to.Ptr("ResourceManager"), - // FriendlyName: to.Ptr("RPtest1"), - // Groups: []*armrecoveryservicessiterecovery.RecoveryPlanGroup{ - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeShutdown), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // }, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeFailover), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // }, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeBoot), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // { - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // VirtualMachineID: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // }}, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeBoot), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // { - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/c0c14913-3d7a-48ea-9531-cc99e0e686e6"), - // VirtualMachineID: to.Ptr("c0c14913-3d7a-48ea-9531-cc99e0e686e6"), - // }}, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }}, - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryFabricID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // ReplicationProviders: []*string{ - // to.Ptr("HyperVReplicaAzure")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Create.json -func ExampleReplicationRecoveryPlansClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationRecoveryPlansClient().BeginCreate(ctx, "vault1", "resourceGroupPS1", "RPtest1", armrecoveryservicessiterecovery.CreateRecoveryPlanInput{ - Properties: &armrecoveryservicessiterecovery.CreateRecoveryPlanInputProperties{ - FailoverDeploymentModel: to.Ptr(armrecoveryservicessiterecovery.FailoverDeploymentModelResourceManager), - Groups: []*armrecoveryservicessiterecovery.RecoveryPlanGroup{ - { - EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{}, - GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeBoot), - ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - { - ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - VirtualMachineID: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - }}, - StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{}, - }}, - PrimaryFabricID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1"), - RecoveryFabricID: to.Ptr("Microsoft Azure"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecoveryPlan = armrecoveryservicessiterecovery.RecoveryPlan{ - // Name: to.Ptr("RPtest1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationRecoveryPlans"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationRecoveryPlans/RPtest1"), - // Properties: &armrecoveryservicessiterecovery.RecoveryPlanProperties{ - // AllowedOperations: []*string{ - // to.Ptr("PlannedFailover"), - // to.Ptr("UnplannedFailover"), - // to.Ptr("TestFailover")}, - // FailoverDeploymentModel: to.Ptr("ResourceManager"), - // FriendlyName: to.Ptr("RPtest1"), - // Groups: []*armrecoveryservicessiterecovery.RecoveryPlanGroup{ - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeShutdown), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // }, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeFailover), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // }, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeBoot), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // { - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // VirtualMachineID: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // }}, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }}, - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryFabricID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // ReplicationProviders: []*string{ - // to.Ptr("HyperVReplicaAzure")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Delete.json -func ExampleReplicationRecoveryPlansClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationRecoveryPlansClient().BeginDelete(ctx, "vault1", "resourceGroupPS1", "RPtest1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Update.json -func ExampleReplicationRecoveryPlansClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationRecoveryPlansClient().BeginUpdate(ctx, "vault1", "resourceGroupPS1", "RPtest1", armrecoveryservicessiterecovery.UpdateRecoveryPlanInput{ - Properties: &armrecoveryservicessiterecovery.UpdateRecoveryPlanInputProperties{ - Groups: []*armrecoveryservicessiterecovery.RecoveryPlanGroup{ - { - EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{}, - GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeShutdown), - ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{}, - StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{}, - }, - { - EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{}, - GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeFailover), - ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{}, - StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{}, - }, - { - EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{}, - GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeBoot), - ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - { - ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - VirtualMachineID: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - }}, - StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{}, - }, - { - EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{}, - GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeBoot), - ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - { - ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/c0c14913-3d7a-48ea-9531-cc99e0e686e6"), - VirtualMachineID: to.Ptr("c0c14913-3d7a-48ea-9531-cc99e0e686e6"), - }}, - StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecoveryPlan = armrecoveryservicessiterecovery.RecoveryPlan{ - // Name: to.Ptr("RPtest1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationRecoveryPlans"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationRecoveryPlans/RPtest1"), - // Properties: &armrecoveryservicessiterecovery.RecoveryPlanProperties{ - // AllowedOperations: []*string{ - // to.Ptr("PlannedFailover"), - // to.Ptr("UnplannedFailover"), - // to.Ptr("TestFailover")}, - // FailoverDeploymentModel: to.Ptr("ResourceManager"), - // FriendlyName: to.Ptr("RPtest1"), - // Groups: []*armrecoveryservicessiterecovery.RecoveryPlanGroup{ - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeShutdown), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // }, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeFailover), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // }, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeBoot), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // { - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // VirtualMachineID: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // }}, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeBoot), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // { - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/c0c14913-3d7a-48ea-9531-cc99e0e686e6"), - // VirtualMachineID: to.Ptr("c0c14913-3d7a-48ea-9531-cc99e0e686e6"), - // }}, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }}, - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryFabricID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // ReplicationProviders: []*string{ - // to.Ptr("HyperVReplicaAzure")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_FailoverCancel.json -func ExampleReplicationRecoveryPlansClient_BeginFailoverCancel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationRecoveryPlansClient().BeginFailoverCancel(ctx, "vault1", "resourceGroupPS1", "RPtest1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecoveryPlan = armrecoveryservicessiterecovery.RecoveryPlan{ - // Name: to.Ptr("RPtest1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationRecoveryPlans"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationRecoveryPlans/RPtest1"), - // Properties: &armrecoveryservicessiterecovery.RecoveryPlanProperties{ - // AllowedOperations: []*string{ - // to.Ptr("PlannedFailover")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/5276a7bc-12a3-43a1-bc53-9bf80e0be87b"), - // ScenarioName: to.Ptr("CancelFailover"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-02-24T08:52:42.1587592Z"); return t}()), - // }, - // CurrentScenarioStatus: to.Ptr("Succeeded"), - // CurrentScenarioStatusDescription: to.Ptr("Completed"), - // FailoverDeploymentModel: to.Ptr("ResourceManager"), - // FriendlyName: to.Ptr("RPtest1"), - // Groups: []*armrecoveryservicessiterecovery.RecoveryPlanGroup{ - // }, - // LastPlannedFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-02-24T07:33:49.1372448Z"); return t}()), - // LastTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1601-01-01T00:00:00.0000000Z"); return t}()), - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryFabricID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1"), - // RecoveryFabricFriendlyName: to.Ptr("cloud1"), - // RecoveryFabricID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1"), - // ReplicationProviders: []*string{ - // to.Ptr("InMageRcmFailback")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_FailoverCommit.json -func ExampleReplicationRecoveryPlansClient_BeginFailoverCommit() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationRecoveryPlansClient().BeginFailoverCommit(ctx, "vault1", "resourceGroupPS1", "RPtest1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecoveryPlan = armrecoveryservicessiterecovery.RecoveryPlan{ - // Name: to.Ptr("RPtest1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationRecoveryPlans"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationRecoveryPlans/RPtest1"), - // Properties: &armrecoveryservicessiterecovery.RecoveryPlanProperties{ - // AllowedOperations: []*string{ - // to.Ptr("PlannedFailover"), - // to.Ptr("UnplannedFailover"), - // to.Ptr("TestFailover")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/5276a7bc-12a3-43a1-bc53-9bf80e0be87b"), - // ScenarioName: to.Ptr("CommitFailover"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T08:52:42.1587592Z"); return t}()), - // }, - // CurrentScenarioStatus: to.Ptr("Succeeded"), - // CurrentScenarioStatusDescription: to.Ptr("Completed"), - // FailoverDeploymentModel: to.Ptr("ResourceManager"), - // FriendlyName: to.Ptr("RPtest1"), - // Groups: []*armrecoveryservicessiterecovery.RecoveryPlanGroup{ - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeShutdown), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // }, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeFailover), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // }, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeBoot), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // { - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // VirtualMachineID: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // }}, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeBoot), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // { - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/c0c14913-3d7a-48ea-9531-cc99e0e686e6"), - // VirtualMachineID: to.Ptr("c0c14913-3d7a-48ea-9531-cc99e0e686e6"), - // }}, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }}, - // LastPlannedFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T07:33:49.1372448Z"); return t}()), - // LastTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T07:00:27.8354747Z"); return t}()), - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryFabricID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // ReplicationProviders: []*string{ - // to.Ptr("HyperVReplicaAzure")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_PlannedFailover.json -func ExampleReplicationRecoveryPlansClient_BeginPlannedFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationRecoveryPlansClient().BeginPlannedFailover(ctx, "vault1", "resourceGroupPS1", "RPtest1", armrecoveryservicessiterecovery.RecoveryPlanPlannedFailoverInput{ - Properties: &armrecoveryservicessiterecovery.RecoveryPlanPlannedFailoverInputProperties{ - FailoverDirection: to.Ptr(armrecoveryservicessiterecovery.PossibleOperationsDirectionsPrimaryToRecovery), - ProviderSpecificDetails: []armrecoveryservicessiterecovery.RecoveryPlanProviderSpecificFailoverInputClassification{ - &armrecoveryservicessiterecovery.RecoveryPlanHyperVReplicaAzureFailoverInput{ - InstanceType: to.Ptr("HyperVReplicaAzure"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecoveryPlan = armrecoveryservicessiterecovery.RecoveryPlan{ - // Name: to.Ptr("RPtest1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationRecoveryPlans"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationRecoveryPlans/RPtest1"), - // Properties: &armrecoveryservicessiterecovery.RecoveryPlanProperties{ - // AllowedOperations: []*string{ - // to.Ptr("PlannedFailover"), - // to.Ptr("UnplannedFailover"), - // to.Ptr("TestFailover"), - // to.Ptr("Commit")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/d4821a53-90da-4fcb-bc11-a280d13e3350"), - // ScenarioName: to.Ptr("PlannedFailover"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T07:34:02.6176524Z"); return t}()), - // }, - // CurrentScenarioStatus: to.Ptr("Succeeded"), - // CurrentScenarioStatusDescription: to.Ptr("Completed"), - // FailoverDeploymentModel: to.Ptr("ResourceManager"), - // FriendlyName: to.Ptr("RPtest1"), - // Groups: []*armrecoveryservicessiterecovery.RecoveryPlanGroup{ - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeShutdown), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // }, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeFailover), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // }, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeBoot), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // { - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // VirtualMachineID: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // }}, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeBoot), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // { - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/c0c14913-3d7a-48ea-9531-cc99e0e686e6"), - // VirtualMachineID: to.Ptr("c0c14913-3d7a-48ea-9531-cc99e0e686e6"), - // }}, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }}, - // LastPlannedFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T07:33:49.1372448Z"); return t}()), - // LastTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T07:00:27.8354747Z"); return t}()), - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryFabricID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // ReplicationProviders: []*string{ - // to.Ptr("HyperVReplicaAzure")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Reprotect.json -func ExampleReplicationRecoveryPlansClient_BeginReprotect() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationRecoveryPlansClient().BeginReprotect(ctx, "vault1", "resourceGroupPS1", "RPtest1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecoveryPlan = armrecoveryservicessiterecovery.RecoveryPlan{ - // Name: to.Ptr("RPtest1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationRecoveryPlans"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationRecoveryPlans/RPtest1"), - // Properties: &armrecoveryservicessiterecovery.RecoveryPlanProperties{ - // AllowedOperations: []*string{ - // to.Ptr("PlannedFailover"), - // to.Ptr("UnplannedFailover"), - // to.Ptr("TestFailover")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/edf01dfb-b649-4802-91e4-3d55ce3bebf0"), - // ScenarioName: to.Ptr("ReverseReplication"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T09:52:16.9818841Z"); return t}()), - // }, - // CurrentScenarioStatus: to.Ptr("Succeeded"), - // CurrentScenarioStatusDescription: to.Ptr("Completed"), - // FailoverDeploymentModel: to.Ptr("ResourceManager"), - // FriendlyName: to.Ptr("RPtest1"), - // Groups: []*armrecoveryservicessiterecovery.RecoveryPlanGroup{ - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeShutdown), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // }, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeFailover), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // }, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeBoot), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // { - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // VirtualMachineID: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // }}, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeBoot), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // { - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/c0c14913-3d7a-48ea-9531-cc99e0e686e6"), - // VirtualMachineID: to.Ptr("c0c14913-3d7a-48ea-9531-cc99e0e686e6"), - // }}, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }}, - // LastPlannedFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T08:58:35.9062813Z"); return t}()), - // LastTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T07:00:27.8354747Z"); return t}()), - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryFabricID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // ReplicationProviders: []*string{ - // to.Ptr("HyperVReplicaAzure")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_TestFailover.json -func ExampleReplicationRecoveryPlansClient_BeginTestFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationRecoveryPlansClient().BeginTestFailover(ctx, "vault1", "resourceGroupPS1", "RPtest1", armrecoveryservicessiterecovery.RecoveryPlanTestFailoverInput{ - Properties: &armrecoveryservicessiterecovery.RecoveryPlanTestFailoverInputProperties{ - FailoverDirection: to.Ptr(armrecoveryservicessiterecovery.PossibleOperationsDirectionsPrimaryToRecovery), - NetworkID: to.Ptr("/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai"), - NetworkType: to.Ptr("VmNetworkAsInput"), - ProviderSpecificDetails: []armrecoveryservicessiterecovery.RecoveryPlanProviderSpecificFailoverInputClassification{ - &armrecoveryservicessiterecovery.RecoveryPlanHyperVReplicaAzureFailoverInput{ - InstanceType: to.Ptr("HyperVReplicaAzure"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecoveryPlan = armrecoveryservicessiterecovery.RecoveryPlan{ - // Name: to.Ptr("RPtest1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationRecoveryPlans"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationRecoveryPlans/RPtest1"), - // Properties: &armrecoveryservicessiterecovery.RecoveryPlanProperties{ - // AllowedOperations: []*string{ - // to.Ptr("TestFailoverCleanup")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/d40bfb40-aaaa-4c0d-87d3-41b15439a84b"), - // ScenarioName: to.Ptr("TestFailover"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T07:00:58.8191916Z"); return t}()), - // }, - // CurrentScenarioStatus: to.Ptr("Suspended"), - // CurrentScenarioStatusDescription: to.Ptr("WaitingForStopTestFailover"), - // FailoverDeploymentModel: to.Ptr("ResourceManager"), - // FriendlyName: to.Ptr("RPtest1"), - // Groups: []*armrecoveryservicessiterecovery.RecoveryPlanGroup{ - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeShutdown), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // }, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeFailover), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // }, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeBoot), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // { - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // VirtualMachineID: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // }}, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeBoot), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // { - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/c0c14913-3d7a-48ea-9531-cc99e0e686e6"), - // VirtualMachineID: to.Ptr("c0c14913-3d7a-48ea-9531-cc99e0e686e6"), - // }}, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }}, - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryFabricID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // ReplicationProviders: []*string{ - // to.Ptr("HyperVReplicaAzure")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_TestFailoverCleanup.json -func ExampleReplicationRecoveryPlansClient_BeginTestFailoverCleanup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationRecoveryPlansClient().BeginTestFailoverCleanup(ctx, "vault1", "resourceGroupPS1", "RPtest1", armrecoveryservicessiterecovery.RecoveryPlanTestFailoverCleanupInput{ - Properties: &armrecoveryservicessiterecovery.RecoveryPlanTestFailoverCleanupInputProperties{ - Comments: to.Ptr("Test Failover Cleanup"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecoveryPlan = armrecoveryservicessiterecovery.RecoveryPlan{ - // Name: to.Ptr("RPtest1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationRecoveryPlans"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationRecoveryPlans/RPtest1"), - // Properties: &armrecoveryservicessiterecovery.RecoveryPlanProperties{ - // AllowedOperations: []*string{ - // to.Ptr("PlannedFailover"), - // to.Ptr("UnplannedFailover"), - // to.Ptr("TestFailover")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/4ae8eaa8-a384-42cb-9768-152cb5b8a1ff"), - // ScenarioName: to.Ptr("TestFailoverCleanup"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T07:10:52.8424747Z"); return t}()), - // }, - // CurrentScenarioStatus: to.Ptr("Succeeded"), - // CurrentScenarioStatusDescription: to.Ptr("Completed"), - // FailoverDeploymentModel: to.Ptr("ResourceManager"), - // FriendlyName: to.Ptr("RPtest1"), - // Groups: []*armrecoveryservicessiterecovery.RecoveryPlanGroup{ - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeShutdown), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // }, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeFailover), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // }, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeBoot), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // { - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // VirtualMachineID: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // }}, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeBoot), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // { - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/c0c14913-3d7a-48ea-9531-cc99e0e686e6"), - // VirtualMachineID: to.Ptr("c0c14913-3d7a-48ea-9531-cc99e0e686e6"), - // }}, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }}, - // LastPlannedFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T07:33:49.1372448Z"); return t}()), - // LastTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T07:00:27.8354747Z"); return t}()), - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryFabricID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // ReplicationProviders: []*string{ - // to.Ptr("HyperVReplicaAzure")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_UnplannedFailover.json -func ExampleReplicationRecoveryPlansClient_BeginUnplannedFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationRecoveryPlansClient().BeginUnplannedFailover(ctx, "vault1", "resourceGroupPS1", "RPtest1", armrecoveryservicessiterecovery.RecoveryPlanUnplannedFailoverInput{ - Properties: &armrecoveryservicessiterecovery.RecoveryPlanUnplannedFailoverInputProperties{ - FailoverDirection: to.Ptr(armrecoveryservicessiterecovery.PossibleOperationsDirectionsPrimaryToRecovery), - ProviderSpecificDetails: []armrecoveryservicessiterecovery.RecoveryPlanProviderSpecificFailoverInputClassification{ - &armrecoveryservicessiterecovery.RecoveryPlanHyperVReplicaAzureFailoverInput{ - InstanceType: to.Ptr("HyperVReplicaAzure"), - }}, - SourceSiteOperations: to.Ptr(armrecoveryservicessiterecovery.SourceSiteOperationsRequired), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecoveryPlan = armrecoveryservicessiterecovery.RecoveryPlan{ - // Name: to.Ptr("RPtest1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationRecoveryPlans"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationRecoveryPlans/RPtest1"), - // Properties: &armrecoveryservicessiterecovery.RecoveryPlanProperties{ - // AllowedOperations: []*string{ - // to.Ptr("PlannedFailover"), - // to.Ptr("UnplannedFailover"), - // to.Ptr("TestFailover"), - // to.Ptr("Commit")}, - // CurrentScenario: &armrecoveryservicessiterecovery.CurrentScenarioDetails{ - // JobID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationJobs/60b84068-9adb-4867-a49d-88be40bff14b"), - // ScenarioName: to.Ptr("UnplannedFailover"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T10:03:03.2206946Z"); return t}()), - // }, - // CurrentScenarioStatus: to.Ptr("Succeeded"), - // CurrentScenarioStatusDescription: to.Ptr("Completed"), - // FailoverDeploymentModel: to.Ptr("ResourceManager"), - // FriendlyName: to.Ptr("RPtest1"), - // Groups: []*armrecoveryservicessiterecovery.RecoveryPlanGroup{ - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeShutdown), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // }, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeFailover), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // }, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeBoot), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // { - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b"), - // VirtualMachineID: to.Ptr("f8491e4f-817a-40dd-a90c-af773978c75b"), - // }}, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }, - // { - // EndGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // GroupType: to.Ptr(armrecoveryservicessiterecovery.RecoveryPlanGroupTypeBoot), - // ReplicationProtectedItems: []*armrecoveryservicessiterecovery.RecoveryPlanProtectedItem{ - // { - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/c0c14913-3d7a-48ea-9531-cc99e0e686e6"), - // VirtualMachineID: to.Ptr("c0c14913-3d7a-48ea-9531-cc99e0e686e6"), - // }}, - // StartGroupActions: []*armrecoveryservicessiterecovery.RecoveryPlanAction{ - // }, - // }}, - // LastPlannedFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T08:58:35.9062813Z"); return t}()), - // LastTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T07:00:27.8354747Z"); return t}()), - // PrimaryFabricFriendlyName: to.Ptr("cloud1"), - // PrimaryFabricID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1"), - // RecoveryFabricFriendlyName: to.Ptr("Microsoft Azure"), - // RecoveryFabricID: to.Ptr("Microsoft Azure"), - // ReplicationProviders: []*string{ - // to.Ptr("HyperVReplicaAzure")}, - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationrecoveryservicesproviders_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationrecoveryservicesproviders_client.go index d104212c441e..fee9fefb7202 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationrecoveryservicesproviders_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationrecoveryservicesproviders_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -47,7 +46,7 @@ func NewReplicationRecoveryServicesProvidersClient(subscriptionID string, creden // BeginCreate - The operation to add a recovery services provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -61,7 +60,8 @@ func (client *ReplicationRecoveryServicesProvidersClient) BeginCreate(ctx contex if err != nil { return nil, err } - return runtime.NewPoller[ReplicationRecoveryServicesProvidersClientCreateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationRecoveryServicesProvidersClientCreateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationRecoveryServicesProvidersClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,20 +70,22 @@ func (client *ReplicationRecoveryServicesProvidersClient) BeginCreate(ctx contex // Create - The operation to add a recovery services provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationRecoveryServicesProvidersClient) create(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, providerName string, addProviderInput AddRecoveryServicesProviderInput, options *ReplicationRecoveryServicesProvidersClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, fabricName, providerName, addProviderInput, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -114,16 +116,19 @@ func (client *ReplicationRecoveryServicesProvidersClient) createCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, addProviderInput) + if err := runtime.MarshalAsJSON(req, addProviderInput); err != nil { + return nil, err + } + return req, nil } // BeginDelete - The operation to removes/delete(unregister) a recovery services provider from the vault. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -136,7 +141,8 @@ func (client *ReplicationRecoveryServicesProvidersClient) BeginDelete(ctx contex if err != nil { return nil, err } - return runtime.NewPoller[ReplicationRecoveryServicesProvidersClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationRecoveryServicesProvidersClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationRecoveryServicesProvidersClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -145,20 +151,22 @@ func (client *ReplicationRecoveryServicesProvidersClient) BeginDelete(ctx contex // Delete - The operation to removes/delete(unregister) a recovery services provider from the vault. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationRecoveryServicesProvidersClient) deleteOperation(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, providerName string, options *ReplicationRecoveryServicesProvidersClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceName, resourceGroupName, fabricName, providerName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -189,7 +197,7 @@ func (client *ReplicationRecoveryServicesProvidersClient) deleteCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -197,7 +205,7 @@ func (client *ReplicationRecoveryServicesProvidersClient) deleteCreateRequest(ct // Get - Gets the details of registered recovery services provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -205,18 +213,21 @@ func (client *ReplicationRecoveryServicesProvidersClient) deleteCreateRequest(ct // - options - ReplicationRecoveryServicesProvidersClientGetOptions contains the optional parameters for the ReplicationRecoveryServicesProvidersClient.Get // method. func (client *ReplicationRecoveryServicesProvidersClient) Get(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, providerName string, options *ReplicationRecoveryServicesProvidersClientGetOptions) (ReplicationRecoveryServicesProvidersClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, providerName, options) if err != nil { return ReplicationRecoveryServicesProvidersClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationRecoveryServicesProvidersClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationRecoveryServicesProvidersClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationRecoveryServicesProvidersClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -247,7 +258,7 @@ func (client *ReplicationRecoveryServicesProvidersClient) getCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,7 +275,7 @@ func (client *ReplicationRecoveryServicesProvidersClient) getHandleResponse(resp // NewListPager - Lists the registered recovery services providers in the vault. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ReplicationRecoveryServicesProvidersClientListOptions contains the optional parameters for the ReplicationRecoveryServicesProvidersClient.NewListPager @@ -317,7 +328,7 @@ func (client *ReplicationRecoveryServicesProvidersClient) listCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -334,7 +345,7 @@ func (client *ReplicationRecoveryServicesProvidersClient) listHandleResponse(res // NewListByReplicationFabricsPager - Lists the registered recovery services providers for the specified fabric. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -392,7 +403,7 @@ func (client *ReplicationRecoveryServicesProvidersClient) listByReplicationFabri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -410,7 +421,7 @@ func (client *ReplicationRecoveryServicesProvidersClient) listByReplicationFabri // BeginPurge - The operation to purge(force delete) a recovery services provider from the vault. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -423,7 +434,8 @@ func (client *ReplicationRecoveryServicesProvidersClient) BeginPurge(ctx context if err != nil { return nil, err } - return runtime.NewPoller[ReplicationRecoveryServicesProvidersClientPurgeResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationRecoveryServicesProvidersClientPurgeResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationRecoveryServicesProvidersClientPurgeResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -432,20 +444,22 @@ func (client *ReplicationRecoveryServicesProvidersClient) BeginPurge(ctx context // Purge - The operation to purge(force delete) a recovery services provider from the vault. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationRecoveryServicesProvidersClient) purge(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, providerName string, options *ReplicationRecoveryServicesProvidersClientBeginPurgeOptions) (*http.Response, error) { + var err error req, err := client.purgeCreateRequest(ctx, resourceName, resourceGroupName, fabricName, providerName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // purgeCreateRequest creates the Purge request. @@ -476,7 +490,7 @@ func (client *ReplicationRecoveryServicesProvidersClient) purgeCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -484,7 +498,7 @@ func (client *ReplicationRecoveryServicesProvidersClient) purgeCreateRequest(ctx // BeginRefreshProvider - The operation to refresh the information from the recovery services provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -497,7 +511,8 @@ func (client *ReplicationRecoveryServicesProvidersClient) BeginRefreshProvider(c if err != nil { return nil, err } - return runtime.NewPoller[ReplicationRecoveryServicesProvidersClientRefreshProviderResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationRecoveryServicesProvidersClientRefreshProviderResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationRecoveryServicesProvidersClientRefreshProviderResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -506,20 +521,22 @@ func (client *ReplicationRecoveryServicesProvidersClient) BeginRefreshProvider(c // RefreshProvider - The operation to refresh the information from the recovery services provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationRecoveryServicesProvidersClient) refreshProvider(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, providerName string, options *ReplicationRecoveryServicesProvidersClientBeginRefreshProviderOptions) (*http.Response, error) { + var err error req, err := client.refreshProviderCreateRequest(ctx, resourceName, resourceGroupName, fabricName, providerName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // refreshProviderCreateRequest creates the RefreshProvider request. @@ -550,7 +567,7 @@ func (client *ReplicationRecoveryServicesProvidersClient) refreshProviderCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationrecoveryservicesproviders_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationrecoveryservicesproviders_client_example_test.go deleted file mode 100644 index 1db85a0c8cf6..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationrecoveryservicesproviders_client_example_test.go +++ /dev/null @@ -1,293 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_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/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_ListByReplicationFabrics.json -func ExampleReplicationRecoveryServicesProvidersClient_NewListByReplicationFabricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationRecoveryServicesProvidersClient().NewListByReplicationFabricsPager("vault1", "resourceGroupPS1", "cloud1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RecoveryServicesProviderCollection = armrecoveryservicessiterecovery.RecoveryServicesProviderCollection{ - // Value: []*armrecoveryservicessiterecovery.RecoveryServicesProvider{ - // { - // Name: to.Ptr("241641e6-ee7b-4ee4-8141-821fadda43fa"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationRecoveryServicesProviders"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/241641e6-ee7b-4ee4-8141-821fadda43fa"), - // Properties: &armrecoveryservicessiterecovery.RecoveryServicesProviderProperties{ - // AllowedScenarios: []*string{ - // to.Ptr("Refresh")}, - // ConnectionStatus: to.Ptr("Connected"), - // FabricFriendlyName: to.Ptr("cloud1"), - // FabricType: to.Ptr("HyperVSite"), - // FriendlyName: to.Ptr("CP-B3L40406-12.ntdev.corp.microsoft.com"), - // LastHeartBeat: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T09:06:38.2728455Z"); return t}()), - // ProtectedItemCount: to.Ptr[int32](2), - // ProviderVersion: to.Ptr("5.1.2250.0"), - // ProviderVersionState: to.Ptr("Latest"), - // ServerVersion: to.Ptr("3.2.7510.0"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Get.json -func ExampleReplicationRecoveryServicesProvidersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationRecoveryServicesProvidersClient().Get(ctx, "vault1", "resourceGroupPS1", "cloud1", "241641e6-ee7b-4ee4-8141-821fadda43fa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecoveryServicesProvider = armrecoveryservicessiterecovery.RecoveryServicesProvider{ - // Name: to.Ptr("241641e6-ee7b-4ee4-8141-821fadda43fa"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationRecoveryServicesProviders"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/241641e6-ee7b-4ee4-8141-821fadda43fa"), - // Properties: &armrecoveryservicessiterecovery.RecoveryServicesProviderProperties{ - // AllowedScenarios: []*string{ - // to.Ptr("Refresh")}, - // ConnectionStatus: to.Ptr("Connected"), - // FabricFriendlyName: to.Ptr("cloud1"), - // FabricType: to.Ptr("HyperVSite"), - // FriendlyName: to.Ptr("CP-B3L40406-12.ntdev.corp.microsoft.com"), - // LastHeartBeat: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T09:16:04.9405768Z"); return t}()), - // ProtectedItemCount: to.Ptr[int32](2), - // ProviderVersion: to.Ptr("5.1.2250.0"), - // ProviderVersionState: to.Ptr("Latest"), - // ServerVersion: to.Ptr("3.2.7510.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Create.json -func ExampleReplicationRecoveryServicesProvidersClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationRecoveryServicesProvidersClient().BeginCreate(ctx, "migrationvault", "resourcegroup1", "vmwarefabric1", "vmwareprovider1", armrecoveryservicessiterecovery.AddRecoveryServicesProviderInput{ - Properties: &armrecoveryservicessiterecovery.AddRecoveryServicesProviderInputProperties{ - AuthenticationIdentityInput: &armrecoveryservicessiterecovery.IdentityProviderInput{ - AADAuthority: to.Ptr("https://login.microsoftonline.com"), - ApplicationID: to.Ptr("f66fce08-c0c6-47a1-beeb-0ede5ea94f90"), - Audience: to.Ptr("https://microsoft.onmicrosoft.com/cf19e349-644c-4c6a-bcae-9c8f35357874"), - ObjectID: to.Ptr("141360b8-5686-4240-a027-5e24e6affeba"), - TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"), - }, - MachineName: to.Ptr("vmwareprovider1"), - ResourceAccessIdentityInput: &armrecoveryservicessiterecovery.IdentityProviderInput{ - AADAuthority: to.Ptr("https://login.microsoftonline.com"), - ApplicationID: to.Ptr("f66fce08-c0c6-47a1-beeb-0ede5ea94f90"), - Audience: to.Ptr("https://microsoft.onmicrosoft.com/cf19e349-644c-4c6a-bcae-9c8f35357874"), - ObjectID: to.Ptr("141360b8-5686-4240-a027-5e24e6affeba"), - TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecoveryServicesProvider = armrecoveryservicessiterecovery.RecoveryServicesProvider{ - // Name: to.Ptr("vmwareprovider1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationRecoveryServicesProviders"), - // ID: to.Ptr("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationFabrics/vmwarefabric1/replicationRecoveryServicesProviders/vmwareprovider1"), - // Properties: &armrecoveryservicessiterecovery.RecoveryServicesProviderProperties{ - // AllowedScenarios: []*string{ - // to.Ptr("Refresh")}, - // ConnectionStatus: to.Ptr("Connected"), - // FabricFriendlyName: to.Ptr("vmwarefabric1"), - // FabricType: to.Ptr("VMwareV2"), - // FriendlyName: to.Ptr("vmwareprovider1"), - // LastHeartBeat: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T09:16:04.9405768Z"); return t}()), - // ProtectedItemCount: to.Ptr[int32](2), - // ProviderVersion: to.Ptr("5.1.3688.0"), - // ProviderVersionState: to.Ptr("Latest"), - // ServerVersion: to.Ptr("3.2.7510.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Purge.json -func ExampleReplicationRecoveryServicesProvidersClient_BeginPurge() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationRecoveryServicesProvidersClient().BeginPurge(ctx, "vault1", "resourceGroupPS1", "cloud1", "241641e6-ee7b-4ee4-8141-821fadda43fa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_RefreshProvider.json -func ExampleReplicationRecoveryServicesProvidersClient_BeginRefreshProvider() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationRecoveryServicesProvidersClient().BeginRefreshProvider(ctx, "vault1", "resourceGroupPS1", "cloud1", "241641e6-ee7b-4ee4-8141-821fadda43fa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecoveryServicesProvider = armrecoveryservicessiterecovery.RecoveryServicesProvider{ - // Name: to.Ptr("241641e6-ee7b-4ee4-8141-821fadda43fa"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationRecoveryServicesProviders"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/241641e6-ee7b-4ee4-8141-821fadda43fa"), - // Properties: &armrecoveryservicessiterecovery.RecoveryServicesProviderProperties{ - // AllowedScenarios: []*string{ - // to.Ptr("Refresh")}, - // ConnectionStatus: to.Ptr("Connected"), - // FabricFriendlyName: to.Ptr("cloud1"), - // FabricType: to.Ptr("HyperVSite"), - // FriendlyName: to.Ptr("CP-B3L40406-12.ntdev.corp.microsoft.com"), - // LastHeartBeat: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T09:48:36.6528303Z"); return t}()), - // ProtectedItemCount: to.Ptr[int32](2), - // ProviderVersion: to.Ptr("5.1.2250.0"), - // ProviderVersionState: to.Ptr("Latest"), - // ServerVersion: to.Ptr("3.2.7510.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Delete.json -func ExampleReplicationRecoveryServicesProvidersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationRecoveryServicesProvidersClient().BeginDelete(ctx, "vault1", "resourceGroupPS1", "cloud1", "241641e6-ee7b-4ee4-8141-821fadda43fa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_List.json -func ExampleReplicationRecoveryServicesProvidersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationRecoveryServicesProvidersClient().NewListPager("vault1", "resourceGroupPS1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RecoveryServicesProviderCollection = armrecoveryservicessiterecovery.RecoveryServicesProviderCollection{ - // Value: []*armrecoveryservicessiterecovery.RecoveryServicesProvider{ - // { - // Name: to.Ptr("241641e6-ee7b-4ee4-8141-821fadda43fa"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationRecoveryServicesProviders"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationRecoveryServicesProviders/241641e6-ee7b-4ee4-8141-821fadda43fa"), - // Properties: &armrecoveryservicessiterecovery.RecoveryServicesProviderProperties{ - // AllowedScenarios: []*string{ - // to.Ptr("Refresh")}, - // ConnectionStatus: to.Ptr("Connected"), - // FabricFriendlyName: to.Ptr("cloud1"), - // FabricType: to.Ptr("HyperVSite"), - // FriendlyName: to.Ptr("CP-B3L40406-12.ntdev.corp.microsoft.com"), - // LastHeartBeat: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T09:06:38.2728455Z"); return t}()), - // ProtectedItemCount: to.Ptr[int32](2), - // ProviderVersion: to.Ptr("5.1.2250.0"), - // ProviderVersionState: to.Ptr("Latest"), - // ServerVersion: to.Ptr("3.2.7510.0"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationstorageclassificationmappings_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationstorageclassificationmappings_client.go index 67a24efb187e..fcd45324eb41 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationstorageclassificationmappings_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationstorageclassificationmappings_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -47,7 +46,7 @@ func NewReplicationStorageClassificationMappingsClient(subscriptionID string, cr // BeginCreate - The operation to create a storage classification mapping. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -62,7 +61,8 @@ func (client *ReplicationStorageClassificationMappingsClient) BeginCreate(ctx co if err != nil { return nil, err } - return runtime.NewPoller[ReplicationStorageClassificationMappingsClientCreateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationStorageClassificationMappingsClientCreateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationStorageClassificationMappingsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ func (client *ReplicationStorageClassificationMappingsClient) BeginCreate(ctx co // Create - The operation to create a storage classification mapping. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationStorageClassificationMappingsClient) create(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput StorageClassificationMappingInput, options *ReplicationStorageClassificationMappingsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, fabricName, storageClassificationName, storageClassificationMappingName, pairingInput, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -119,16 +121,19 @@ func (client *ReplicationStorageClassificationMappingsClient) createCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, pairingInput) + if err := runtime.MarshalAsJSON(req, pairingInput); err != nil { + return nil, err + } + return req, nil } // BeginDelete - The operation to delete a storage classification mapping. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -142,7 +147,8 @@ func (client *ReplicationStorageClassificationMappingsClient) BeginDelete(ctx co if err != nil { return nil, err } - return runtime.NewPoller[ReplicationStorageClassificationMappingsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationStorageClassificationMappingsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationStorageClassificationMappingsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -151,20 +157,22 @@ func (client *ReplicationStorageClassificationMappingsClient) BeginDelete(ctx co // Delete - The operation to delete a storage classification mapping. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationStorageClassificationMappingsClient) deleteOperation(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, storageClassificationName string, storageClassificationMappingName string, options *ReplicationStorageClassificationMappingsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceName, resourceGroupName, fabricName, storageClassificationName, storageClassificationMappingName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -199,7 +207,7 @@ func (client *ReplicationStorageClassificationMappingsClient) deleteCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -207,7 +215,7 @@ func (client *ReplicationStorageClassificationMappingsClient) deleteCreateReques // Get - Gets the details of the specified storage classification mapping. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -216,18 +224,21 @@ func (client *ReplicationStorageClassificationMappingsClient) deleteCreateReques // - options - ReplicationStorageClassificationMappingsClientGetOptions contains the optional parameters for the ReplicationStorageClassificationMappingsClient.Get // method. func (client *ReplicationStorageClassificationMappingsClient) Get(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, storageClassificationName string, storageClassificationMappingName string, options *ReplicationStorageClassificationMappingsClientGetOptions) (ReplicationStorageClassificationMappingsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, storageClassificationName, storageClassificationMappingName, options) if err != nil { return ReplicationStorageClassificationMappingsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationStorageClassificationMappingsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationStorageClassificationMappingsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationStorageClassificationMappingsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -262,7 +273,7 @@ func (client *ReplicationStorageClassificationMappingsClient) getCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,7 +290,7 @@ func (client *ReplicationStorageClassificationMappingsClient) getHandleResponse( // NewListPager - Lists the storage classification mappings in the vault. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ReplicationStorageClassificationMappingsClientListOptions contains the optional parameters for the ReplicationStorageClassificationMappingsClient.NewListPager @@ -332,7 +343,7 @@ func (client *ReplicationStorageClassificationMappingsClient) listCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -349,7 +360,7 @@ func (client *ReplicationStorageClassificationMappingsClient) listHandleResponse // NewListByReplicationStorageClassificationsPager - Lists the storage classification mappings for the fabric. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -412,7 +423,7 @@ func (client *ReplicationStorageClassificationMappingsClient) listByReplicationS return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationstorageclassificationmappings_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationstorageclassificationmappings_client_example_test.go deleted file mode 100644 index 3decce91ca46..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationstorageclassificationmappings_client_example_test.go +++ /dev/null @@ -1,176 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_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/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_ListByReplicationStorageClassifications.json -func ExampleReplicationStorageClassificationMappingsClient_NewListByReplicationStorageClassificationsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationStorageClassificationMappingsClient().NewListByReplicationStorageClassificationsPager("vault1", "resourceGroupPS1", "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0", "8891569e-aaef-4a46-a4a0-78c14f2d7b09", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.StorageClassificationMappingCollection = armrecoveryservicessiterecovery.StorageClassificationMappingCollection{ - // Value: []*armrecoveryservicessiterecovery.StorageClassificationMapping{ - // { - // Name: to.Ptr("testStorageMapping"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationStorageClassifications/replicationStorageClassificationMappings"), - // ID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0/replicationStorageClassifications/8891569e-aaef-4a46-a4a0-78c14f2d7b09/replicationStorageClassificationMappings/testStorageMapping"), - // Properties: &armrecoveryservicessiterecovery.StorageClassificationMappingProperties{ - // TargetStorageClassificationID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0/replicationStorageClassifications/8891569e-aaef-4a46-a4a0-78c14f2d7b09"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_Get.json -func ExampleReplicationStorageClassificationMappingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationStorageClassificationMappingsClient().Get(ctx, "vault1", "resourceGroupPS1", "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0", "8891569e-aaef-4a46-a4a0-78c14f2d7b09", "testStorageMapping", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StorageClassificationMapping = armrecoveryservicessiterecovery.StorageClassificationMapping{ - // Name: to.Ptr("testStorageMapping"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationStorageClassifications/replicationStorageClassificationMappings"), - // ID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0/replicationStorageClassifications/8891569e-aaef-4a46-a4a0-78c14f2d7b09/replicationStorageClassificationMappings/testStorageMapping"), - // Properties: &armrecoveryservicessiterecovery.StorageClassificationMappingProperties{ - // TargetStorageClassificationID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0/replicationStorageClassifications/8891569e-aaef-4a46-a4a0-78c14f2d7b09"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_Create.json -func ExampleReplicationStorageClassificationMappingsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationStorageClassificationMappingsClient().BeginCreate(ctx, "vault1", "resourceGroupPS1", "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0", "8891569e-aaef-4a46-a4a0-78c14f2d7b09", "testStorageMapping", armrecoveryservicessiterecovery.StorageClassificationMappingInput{ - Properties: &armrecoveryservicessiterecovery.StorageMappingInputProperties{ - TargetStorageClassificationID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0/replicationStorageClassifications/8891569e-aaef-4a46-a4a0-78c14f2d7b09"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StorageClassificationMapping = armrecoveryservicessiterecovery.StorageClassificationMapping{ - // Name: to.Ptr("testStorageMapping"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationStorageClassifications/replicationStorageClassificationMappings"), - // ID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0/replicationStorageClassifications/8891569e-aaef-4a46-a4a0-78c14f2d7b09/replicationStorageClassificationMappings/testStorageMapping"), - // Properties: &armrecoveryservicessiterecovery.StorageClassificationMappingProperties{ - // TargetStorageClassificationID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0/replicationStorageClassifications/8891569e-aaef-4a46-a4a0-78c14f2d7b09"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_Delete.json -func ExampleReplicationStorageClassificationMappingsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationStorageClassificationMappingsClient().BeginDelete(ctx, "vault1", "resourceGroupPS1", "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0", "8891569e-aaef-4a46-a4a0-78c14f2d7b09", "testStorageMapping", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_List.json -func ExampleReplicationStorageClassificationMappingsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationStorageClassificationMappingsClient().NewListPager("vault1", "resourceGroupPS1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.StorageClassificationMappingCollection = armrecoveryservicessiterecovery.StorageClassificationMappingCollection{ - // Value: []*armrecoveryservicessiterecovery.StorageClassificationMapping{ - // { - // Name: to.Ptr("testStorageMapping"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationStorageClassifications/replicationStorageClassificationMappings"), - // ID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0/replicationStorageClassifications/8891569e-aaef-4a46-a4a0-78c14f2d7b09/replicationStorageClassificationMappings/testStorageMapping"), - // Properties: &armrecoveryservicessiterecovery.StorageClassificationMappingProperties{ - // TargetStorageClassificationID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0/replicationStorageClassifications/8891569e-aaef-4a46-a4a0-78c14f2d7b09"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationstorageclassifications_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationstorageclassifications_client.go index d07d27fd4b85..dac12f89f93e 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationstorageclassifications_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationstorageclassifications_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -47,7 +46,7 @@ func NewReplicationStorageClassificationsClient(subscriptionID string, credentia // Get - Gets the details of the specified storage classification. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -55,18 +54,21 @@ func NewReplicationStorageClassificationsClient(subscriptionID string, credentia // - options - ReplicationStorageClassificationsClientGetOptions contains the optional parameters for the ReplicationStorageClassificationsClient.Get // method. func (client *ReplicationStorageClassificationsClient) Get(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, storageClassificationName string, options *ReplicationStorageClassificationsClientGetOptions) (ReplicationStorageClassificationsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, storageClassificationName, options) if err != nil { return ReplicationStorageClassificationsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationStorageClassificationsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationStorageClassificationsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationStorageClassificationsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -97,7 +99,7 @@ func (client *ReplicationStorageClassificationsClient) getCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,7 +116,7 @@ func (client *ReplicationStorageClassificationsClient) getHandleResponse(resp *h // NewListPager - Lists the storage classifications in the vault. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ReplicationStorageClassificationsClientListOptions contains the optional parameters for the ReplicationStorageClassificationsClient.NewListPager @@ -167,7 +169,7 @@ func (client *ReplicationStorageClassificationsClient) listCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -184,7 +186,7 @@ func (client *ReplicationStorageClassificationsClient) listHandleResponse(resp * // NewListByReplicationFabricsPager - Lists the storage classifications available in the specified fabric. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Site name of interest. @@ -242,7 +244,7 @@ func (client *ReplicationStorageClassificationsClient) listByReplicationFabricsC return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationstorageclassifications_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationstorageclassifications_client_example_test.go deleted file mode 100644 index 748d409b0a00..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationstorageclassifications_client_example_test.go +++ /dev/null @@ -1,118 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassifications_ListByReplicationFabrics.json -func ExampleReplicationStorageClassificationsClient_NewListByReplicationFabricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationStorageClassificationsClient().NewListByReplicationFabricsPager("vault1", "resourceGroupPS1", "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.StorageClassificationCollection = armrecoveryservicessiterecovery.StorageClassificationCollection{ - // Value: []*armrecoveryservicessiterecovery.StorageClassification{ - // { - // Name: to.Ptr("8891569e-aaef-4a46-a4a0-78c14f2d7b09"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationStorageClassifications"), - // ID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0/replicationStorageClassifications/8891569e-aaef-4a46-a4a0-78c14f2d7b09"), - // Properties: &armrecoveryservicessiterecovery.StorageClassificationProperties{ - // FriendlyName: to.Ptr("testStorageClassification"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassifications_Get.json -func ExampleReplicationStorageClassificationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationStorageClassificationsClient().Get(ctx, "vault1", "resourceGroupPS1", "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0", "8891569e-aaef-4a46-a4a0-78c14f2d7b09", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StorageClassification = armrecoveryservicessiterecovery.StorageClassification{ - // Name: to.Ptr("8891569e-aaef-4a46-a4a0-78c14f2d7b09"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationStorageClassifications"), - // ID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0/replicationStorageClassifications/8891569e-aaef-4a46-a4a0-78c14f2d7b09"), - // Properties: &armrecoveryservicessiterecovery.StorageClassificationProperties{ - // FriendlyName: to.Ptr("testStorageClassification"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassifications_List.json -func ExampleReplicationStorageClassificationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationStorageClassificationsClient().NewListPager("vault1", "resourceGroupPS1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.StorageClassificationCollection = armrecoveryservicessiterecovery.StorageClassificationCollection{ - // Value: []*armrecoveryservicessiterecovery.StorageClassification{ - // { - // Name: to.Ptr("8891569e-aaef-4a46-a4a0-78c14f2d7b09"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationStorageClassifications"), - // ID: to.Ptr("/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0/replicationStorageClassifications/8891569e-aaef-4a46-a4a0-78c14f2d7b09"), - // Properties: &armrecoveryservicessiterecovery.StorageClassificationProperties{ - // FriendlyName: to.Ptr("testStorageClassification"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvaulthealth_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvaulthealth_client.go index d1c6f84004b8..b03bed7a922b 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvaulthealth_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvaulthealth_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -47,24 +46,27 @@ func NewReplicationVaultHealthClient(subscriptionID string, credential azcore.To // Get - Gets the health details of the vault. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ReplicationVaultHealthClientGetOptions contains the optional parameters for the ReplicationVaultHealthClient.Get // method. func (client *ReplicationVaultHealthClient) Get(ctx context.Context, resourceName string, resourceGroupName string, options *ReplicationVaultHealthClientGetOptions) (ReplicationVaultHealthClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, options) if err != nil { return ReplicationVaultHealthClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationVaultHealthClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationVaultHealthClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationVaultHealthClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -87,7 +89,7 @@ func (client *ReplicationVaultHealthClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -105,7 +107,7 @@ func (client *ReplicationVaultHealthClient) getHandleResponse(resp *http.Respons // BeginRefresh - Refreshes health summary of the vault. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ReplicationVaultHealthClientBeginRefreshOptions contains the optional parameters for the ReplicationVaultHealthClient.BeginRefresh @@ -116,7 +118,8 @@ func (client *ReplicationVaultHealthClient) BeginRefresh(ctx context.Context, re if err != nil { return nil, err } - return runtime.NewPoller[ReplicationVaultHealthClientRefreshResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationVaultHealthClientRefreshResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationVaultHealthClientRefreshResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -125,20 +128,22 @@ func (client *ReplicationVaultHealthClient) BeginRefresh(ctx context.Context, re // Refresh - Refreshes health summary of the vault. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationVaultHealthClient) refresh(ctx context.Context, resourceName string, resourceGroupName string, options *ReplicationVaultHealthClientBeginRefreshOptions) (*http.Response, error) { + var err error req, err := client.refreshCreateRequest(ctx, resourceName, resourceGroupName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // refreshCreateRequest creates the Refresh request. @@ -161,7 +166,7 @@ func (client *ReplicationVaultHealthClient) refreshCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvaulthealth_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvaulthealth_client_example_test.go deleted file mode 100644 index 0bf43ecd516f..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvaulthealth_client_example_test.go +++ /dev/null @@ -1,110 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultHealth_Get.json -func ExampleReplicationVaultHealthClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationVaultHealthClient().Get(ctx, "vault1", "resourceGroupPS1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VaultHealthDetails = armrecoveryservicessiterecovery.VaultHealthDetails{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationVaultHealth"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationVaultHealth/Default"), - // Properties: &armrecoveryservicessiterecovery.VaultHealthProperties{ - // FabricsHealth: &armrecoveryservicessiterecovery.ResourceHealthSummary{ - // Issues: []*armrecoveryservicessiterecovery.HealthErrorSummary{ - // }, - // ResourceCount: to.Ptr[int32](1), - // }, - // ProtectedItemsHealth: &armrecoveryservicessiterecovery.ResourceHealthSummary{ - // Issues: []*armrecoveryservicessiterecovery.HealthErrorSummary{ - // { - // AffectedResourceCorrelationIDs: []*string{ - // to.Ptr("c183865e-6077-46f2-a3b1-deb0f4f4650a"), - // to.Ptr("c183865e-6077-46f2-a3b1-ceb0a4c3751e")}, - // AffectedResourceSubtype: to.Ptr(""), - // AffectedResourceType: to.Ptr("replicationProtectedItems"), - // Category: to.Ptr(armrecoveryservicessiterecovery.HealthErrorCategoryReplication), - // Severity: to.Ptr(armrecoveryservicessiterecovery.SeverityError), - // SummaryCode: to.Ptr("10008"), - // SummaryMessage: to.Ptr("RPO Throttled"), - // }}, - // ResourceCount: to.Ptr[int32](6), - // }, - // VaultErrors: []*armrecoveryservicessiterecovery.HealthError{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultHealth_Refresh.json -func ExampleReplicationVaultHealthClient_BeginRefresh() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationVaultHealthClient().BeginRefresh(ctx, "vault1", "resourceGroupPS1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VaultHealthDetails = armrecoveryservicessiterecovery.VaultHealthDetails{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationVaultHealth"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationVaultHealth/Default"), - // Properties: &armrecoveryservicessiterecovery.VaultHealthProperties{ - // FabricsHealth: &armrecoveryservicessiterecovery.ResourceHealthSummary{ - // Issues: []*armrecoveryservicessiterecovery.HealthErrorSummary{ - // }, - // ResourceCount: to.Ptr[int32](1), - // }, - // ProtectedItemsHealth: &armrecoveryservicessiterecovery.ResourceHealthSummary{ - // Issues: []*armrecoveryservicessiterecovery.HealthErrorSummary{ - // }, - // ResourceCount: to.Ptr[int32](2), - // }, - // VaultErrors: []*armrecoveryservicessiterecovery.HealthError{ - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvaultsetting_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvaultsetting_client.go index 511f7992bcb0..d8d3703fa90b 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvaultsetting_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvaultsetting_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -47,7 +46,7 @@ func NewReplicationVaultSettingClient(subscriptionID string, credential azcore.T // BeginCreate - The operation to configure vault setting. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - vaultSettingName - Vault setting name. @@ -60,7 +59,8 @@ func (client *ReplicationVaultSettingClient) BeginCreate(ctx context.Context, re if err != nil { return nil, err } - return runtime.NewPoller[ReplicationVaultSettingClientCreateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationVaultSettingClientCreateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationVaultSettingClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -69,20 +69,22 @@ func (client *ReplicationVaultSettingClient) BeginCreate(ctx context.Context, re // Create - The operation to configure vault setting. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationVaultSettingClient) create(ctx context.Context, resourceName string, resourceGroupName string, vaultSettingName string, input VaultSettingCreationInput, options *ReplicationVaultSettingClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, vaultSettingName, input, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -109,34 +111,40 @@ func (client *ReplicationVaultSettingClient) createCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, input) + if err := runtime.MarshalAsJSON(req, input); err != nil { + return nil, err + } + return req, nil } // Get - Gets the vault setting. This includes the Migration Hub connection settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - vaultSettingName - Vault setting name. // - options - ReplicationVaultSettingClientGetOptions contains the optional parameters for the ReplicationVaultSettingClient.Get // method. func (client *ReplicationVaultSettingClient) Get(ctx context.Context, resourceName string, resourceGroupName string, vaultSettingName string, options *ReplicationVaultSettingClientGetOptions) (ReplicationVaultSettingClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, vaultSettingName, options) if err != nil { return ReplicationVaultSettingClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationVaultSettingClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationVaultSettingClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationVaultSettingClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -163,7 +171,7 @@ func (client *ReplicationVaultSettingClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +188,7 @@ func (client *ReplicationVaultSettingClient) getHandleResponse(resp *http.Respon // NewListPager - Gets the list of vault setting. This includes the Migration Hub connection settings. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ReplicationVaultSettingClientListOptions contains the optional parameters for the ReplicationVaultSettingClient.NewListPager @@ -233,7 +241,7 @@ func (client *ReplicationVaultSettingClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvaultsetting_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvaultsetting_client_example_test.go deleted file mode 100644 index de54affc5b0e..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvaultsetting_client_example_test.go +++ /dev/null @@ -1,119 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_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/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultSetting_List.json -func ExampleReplicationVaultSettingClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationVaultSettingClient().NewListPager("vault1", "resourceGroupPS1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VaultSettingCollection = armrecoveryservicessiterecovery.VaultSettingCollection{ - // Value: []*armrecoveryservicessiterecovery.VaultSetting{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationVaultSettings"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationVaultSettings/default"), - // Properties: &armrecoveryservicessiterecovery.VaultSettingProperties{ - // MigrationSolutionID: to.Ptr("/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.Migrate/MigrateProjects/resourceGroupPS1-MigrateProject/Solutions/Servers-Migration-ServerMigration"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultSetting_Get.json -func ExampleReplicationVaultSettingClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationVaultSettingClient().Get(ctx, "vault1", "resourceGroupPS1", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VaultSetting = armrecoveryservicessiterecovery.VaultSetting{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationVaultSettings"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationVaultSettings/default"), - // Properties: &armrecoveryservicessiterecovery.VaultSettingProperties{ - // MigrationSolutionID: to.Ptr("/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.Migrate/MigrateProjects/resourceGroupPS1-MigrateProject/Solutions/Servers-Migration-ServerMigration"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultSetting_Create.json -func ExampleReplicationVaultSettingClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationVaultSettingClient().BeginCreate(ctx, "vault1", "resourceGroupPS1", "default", armrecoveryservicessiterecovery.VaultSettingCreationInput{ - Properties: &armrecoveryservicessiterecovery.VaultSettingCreationInputProperties{ - MigrationSolutionID: to.Ptr("/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.Migrate/MigrateProjects/resourceGroupPS1-MigrateProject/Solutions/Servers-Migration-ServerMigration"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VaultSetting = armrecoveryservicessiterecovery.VaultSetting{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationVaultSettings"), - // ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationVaultSettings/default"), - // Properties: &armrecoveryservicessiterecovery.VaultSettingProperties{ - // MigrationSolutionID: to.Ptr("/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.Migrate/MigrateProjects/resourceGroupPS1-MigrateProject/Solutions/Servers-Migration-ServerMigration"), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvcenters_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvcenters_client.go index 2e1bdda1e93b..bca21963e9c4 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvcenters_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvcenters_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -47,7 +46,7 @@ func NewReplicationvCentersClient(subscriptionID string, credential azcore.Token // BeginCreate - The operation to create a vCenter object.. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -61,7 +60,8 @@ func (client *ReplicationvCentersClient) BeginCreate(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller[ReplicationvCentersClientCreateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationvCentersClientCreateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationvCentersClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,20 +70,22 @@ func (client *ReplicationvCentersClient) BeginCreate(ctx context.Context, resour // Create - The operation to create a vCenter object.. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationvCentersClient) create(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, vcenterName string, addVCenterRequest AddVCenterRequest, options *ReplicationvCentersClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, fabricName, vcenterName, addVCenterRequest, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -114,16 +116,19 @@ func (client *ReplicationvCentersClient) createCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, addVCenterRequest) + if err := runtime.MarshalAsJSON(req, addVCenterRequest); err != nil { + return nil, err + } + return req, nil } // BeginDelete - The operation to remove(unregister) a registered vCenter server from the vault. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -136,7 +141,8 @@ func (client *ReplicationvCentersClient) BeginDelete(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller[ReplicationvCentersClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationvCentersClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationvCentersClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -145,20 +151,22 @@ func (client *ReplicationvCentersClient) BeginDelete(ctx context.Context, resour // Delete - The operation to remove(unregister) a registered vCenter server from the vault. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationvCentersClient) deleteOperation(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, vcenterName string, options *ReplicationvCentersClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceName, resourceGroupName, fabricName, vcenterName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -189,7 +197,7 @@ func (client *ReplicationvCentersClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -197,25 +205,28 @@ func (client *ReplicationvCentersClient) deleteCreateRequest(ctx context.Context // Get - Gets the details of a registered vCenter server(Add vCenter server). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. // - vcenterName - vcenter name. // - options - ReplicationvCentersClientGetOptions contains the optional parameters for the ReplicationvCentersClient.Get method. func (client *ReplicationvCentersClient) Get(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, vcenterName string, options *ReplicationvCentersClientGetOptions) (ReplicationvCentersClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, vcenterName, options) if err != nil { return ReplicationvCentersClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ReplicationvCentersClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationvCentersClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationvCentersClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -246,7 +257,7 @@ func (client *ReplicationvCentersClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -263,7 +274,7 @@ func (client *ReplicationvCentersClient) getHandleResponse(resp *http.Response) // NewListPager - Lists the vCenter servers registered in the vault. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ReplicationvCentersClientListOptions contains the optional parameters for the ReplicationvCentersClient.NewListPager @@ -316,7 +327,7 @@ func (client *ReplicationvCentersClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -333,7 +344,7 @@ func (client *ReplicationvCentersClient) listHandleResponse(resp *http.Response) // NewListByReplicationFabricsPager - Lists the vCenter servers registered in a fabric. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -391,7 +402,7 @@ func (client *ReplicationvCentersClient) listByReplicationFabricsCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -409,7 +420,7 @@ func (client *ReplicationvCentersClient) listByReplicationFabricsHandleResponse( // BeginUpdate - The operation to update a registered vCenter. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -423,7 +434,8 @@ func (client *ReplicationvCentersClient) BeginUpdate(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller[ReplicationvCentersClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ReplicationvCentersClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ReplicationvCentersClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -432,20 +444,22 @@ func (client *ReplicationvCentersClient) BeginUpdate(ctx context.Context, resour // Update - The operation to update a registered vCenter. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 func (client *ReplicationvCentersClient) update(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, vcenterName string, updateVCenterRequest UpdateVCenterRequest, options *ReplicationvCentersClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceName, resourceGroupName, fabricName, vcenterName, updateVCenterRequest, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -476,8 +490,11 @@ func (client *ReplicationvCentersClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, updateVCenterRequest) + if err := runtime.MarshalAsJSON(req, updateVCenterRequest); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvcenters_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvcenters_client_example_test.go deleted file mode 100644 index c4da99c4e0fb..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvcenters_client_example_test.go +++ /dev/null @@ -1,251 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_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/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_ListByReplicationFabrics.json -func ExampleReplicationvCentersClient_NewListByReplicationFabricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationvCentersClient().NewListByReplicationFabricsPager("MadhaviVault", "MadhaviVRG", "MadhaviFabric", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VCenterCollection = armrecoveryservicessiterecovery.VCenterCollection{ - // Value: []*armrecoveryservicessiterecovery.VCenter{ - // { - // Name: to.Ptr("esx-78"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationvCenters"), - // ID: to.Ptr("/Subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/MadhaviVRG/providers/Microsoft.RecoveryServices/vaults/MadhaviVault/replicationFabrics/239f778f368e34f78216d81f030725cdf2033174b47879b9f2eeede06fdd9c4d/replicationvCenters/esx-78"), - // Properties: &armrecoveryservicessiterecovery.VCenterProperties{ - // DiscoveryStatus: to.Ptr("Pending"), - // FabricArmResourceName: to.Ptr("239f778f368e34f78216d81f030725cdf2033174b47879b9f2eeede06fdd9c4d"), - // FriendlyName: to.Ptr("esx-78"), - // InternalID: to.Ptr("inmtest78"), - // IPAddress: to.Ptr("inmtest78"), - // Port: to.Ptr("443"), - // ProcessServerID: to.Ptr("5A720CAB-39CB-F445-BD1662B0B33164B5"), - // RunAsAccountID: to.Ptr("2"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Get.json -func ExampleReplicationvCentersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationvCentersClient().Get(ctx, "MadhaviVault", "MadhaviVRG", "MadhaviFabric", "esx-78", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VCenter = armrecoveryservicessiterecovery.VCenter{ - // Name: to.Ptr("esx-78"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationvCenters"), - // ID: to.Ptr("/Subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/MadhaviVRG/providers/Microsoft.RecoveryServices/vaults/MadhaviVault/replicationFabrics/239f778f368e34f78216d81f030725cdf2033174b47879b9f2eeede06fdd9c4d/replicationvCenters/esx-78"), - // Properties: &armrecoveryservicessiterecovery.VCenterProperties{ - // DiscoveryStatus: to.Ptr("Pending"), - // FabricArmResourceName: to.Ptr("239f778f368e34f78216d81f030725cdf2033174b47879b9f2eeede06fdd9c4d"), - // FriendlyName: to.Ptr("esx-78"), - // InternalID: to.Ptr("inmtest78"), - // IPAddress: to.Ptr("inmtest78"), - // Port: to.Ptr("443"), - // ProcessServerID: to.Ptr("5A720CAB-39CB-F445-BD1662B0B33164B5"), - // RunAsAccountID: to.Ptr("2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Create.json -func ExampleReplicationvCentersClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationvCentersClient().BeginCreate(ctx, "MadhaviVault", "MadhaviVRG", "MadhaviFabric", "esx-78", armrecoveryservicessiterecovery.AddVCenterRequest{ - Properties: &armrecoveryservicessiterecovery.AddVCenterRequestProperties{ - FriendlyName: to.Ptr("esx-78"), - IPAddress: to.Ptr("inmtest78"), - Port: to.Ptr("443"), - ProcessServerID: to.Ptr("5A720CAB-39CB-F445-BD1662B0B33164B5"), - RunAsAccountID: to.Ptr("2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VCenter = armrecoveryservicessiterecovery.VCenter{ - // Name: to.Ptr("esx-78"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationvCenters"), - // ID: to.Ptr("/Subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/MadhaviVRG/providers/Microsoft.RecoveryServices/vaults/MadhaviVault/replicationFabrics/239f778f368e34f78216d81f030725cdf2033174b47879b9f2eeede06fdd9c4d/replicationvCenters/esx-78"), - // Properties: &armrecoveryservicessiterecovery.VCenterProperties{ - // DiscoveryStatus: to.Ptr("Pending"), - // FabricArmResourceName: to.Ptr("239f778f368e34f78216d81f030725cdf2033174b47879b9f2eeede06fdd9c4d"), - // FriendlyName: to.Ptr("esx-78"), - // InternalID: to.Ptr("inmtest78"), - // IPAddress: to.Ptr("inmtest78"), - // Port: to.Ptr("443"), - // ProcessServerID: to.Ptr("5A720CAB-39CB-F445-BD1662B0B33164B5"), - // RunAsAccountID: to.Ptr("2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Delete.json -func ExampleReplicationvCentersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationvCentersClient().BeginDelete(ctx, "MadhaviVault", "MadhaviVRG", "MadhaviFabric", "esx-78", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Update.json -func ExampleReplicationvCentersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationvCentersClient().BeginUpdate(ctx, "MadhaviVault", "MadhaviVRG", "MadhaviFabric", "esx-78", armrecoveryservicessiterecovery.UpdateVCenterRequest{ - Properties: &armrecoveryservicessiterecovery.UpdateVCenterRequestProperties{ - IPAddress: to.Ptr("10.150.109.25"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VCenter = armrecoveryservicessiterecovery.VCenter{ - // Name: to.Ptr("esx-78"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationvCenters"), - // ID: to.Ptr("/Subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/MadhaviVRG/providers/Microsoft.RecoveryServices/vaults/MadhaviVault/replicationFabrics/239f778f368e34f78216d81f030725cdf2033174b47879b9f2eeede06fdd9c4d/replicationvCenters/esx-78"), - // Properties: &armrecoveryservicessiterecovery.VCenterProperties{ - // DiscoveryStatus: to.Ptr("Pending"), - // FabricArmResourceName: to.Ptr("239f778f368e34f78216d81f030725cdf2033174b47879b9f2eeede06fdd9c4d"), - // FriendlyName: to.Ptr("esx-78"), - // InternalID: to.Ptr("inmtest78"), - // IPAddress: to.Ptr("10.150.109.25"), - // Port: to.Ptr("443"), - // ProcessServerID: to.Ptr("5A720CAB-39CB-F445-BD1662B0B33164B5"), - // RunAsAccountID: to.Ptr("2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_List.json -func ExampleReplicationvCentersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationvCentersClient().NewListPager("MadhaviVault", "MadhaviVRG", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VCenterCollection = armrecoveryservicessiterecovery.VCenterCollection{ - // Value: []*armrecoveryservicessiterecovery.VCenter{ - // { - // Name: to.Ptr("esx-78"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationvCenters"), - // ID: to.Ptr("/Subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/MadhaviVRG/providers/Microsoft.RecoveryServices/vaults/MadhaviVault/replicationFabrics/239f778f368e34f78216d81f030725cdf2033174b47879b9f2eeede06fdd9c4d/replicationvCenters/esx-78"), - // Properties: &armrecoveryservicessiterecovery.VCenterProperties{ - // DiscoveryStatus: to.Ptr("Pending"), - // FabricArmResourceName: to.Ptr("239f778f368e34f78216d81f030725cdf2033174b47879b9f2eeede06fdd9c4d"), - // FriendlyName: to.Ptr("esx-78"), - // InternalID: to.Ptr("inmtest78"), - // IPAddress: to.Ptr("inmtest78"), - // Port: to.Ptr("443"), - // ProcessServerID: to.Ptr("5A720CAB-39CB-F445-BD1662B0B33164B5"), - // RunAsAccountID: to.Ptr("2"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/response_types.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/response_types.go index 0552a0ba2392..e5e0ae001de5 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/response_types.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/response_types.go @@ -3,84 +3,98 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery // MigrationRecoveryPointsClientGetResponse contains the response from method MigrationRecoveryPointsClient.Get. type MigrationRecoveryPointsClientGetResponse struct { + // Recovery point for a migration item. MigrationRecoveryPoint } // MigrationRecoveryPointsClientListByReplicationMigrationItemsResponse contains the response from method MigrationRecoveryPointsClient.NewListByReplicationMigrationItemsPager. type MigrationRecoveryPointsClientListByReplicationMigrationItemsResponse struct { + // Collection of migration recovery points. MigrationRecoveryPointCollection } // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // Collection of ClientDiscovery details. OperationsDiscoveryCollection } // RecoveryPointsClientGetResponse contains the response from method RecoveryPointsClient.Get. type RecoveryPointsClientGetResponse struct { + // Recovery point. RecoveryPoint } // RecoveryPointsClientListByReplicationProtectedItemsResponse contains the response from method RecoveryPointsClient.NewListByReplicationProtectedItemsPager. type RecoveryPointsClientListByReplicationProtectedItemsResponse struct { + // Collection of recovery point details. RecoveryPointCollection } // ReplicationAlertSettingsClientCreateResponse contains the response from method ReplicationAlertSettingsClient.Create. type ReplicationAlertSettingsClientCreateResponse struct { + // Implements the Alert class. Alert } // ReplicationAlertSettingsClientGetResponse contains the response from method ReplicationAlertSettingsClient.Get. type ReplicationAlertSettingsClientGetResponse struct { + // Implements the Alert class. Alert } // ReplicationAlertSettingsClientListResponse contains the response from method ReplicationAlertSettingsClient.NewListPager. type ReplicationAlertSettingsClientListResponse struct { + // Collection of alerts. AlertCollection } // ReplicationAppliancesClientListResponse contains the response from method ReplicationAppliancesClient.NewListPager. type ReplicationAppliancesClientListResponse struct { + // Collection of appliance details. ApplianceCollection } // ReplicationEligibilityResultsClientGetResponse contains the response from method ReplicationEligibilityResultsClient.Get. type ReplicationEligibilityResultsClientGetResponse struct { + // Replication eligibility results response model. ReplicationEligibilityResults } // ReplicationEligibilityResultsClientListResponse contains the response from method ReplicationEligibilityResultsClient.List. type ReplicationEligibilityResultsClientListResponse struct { + // Replication eligibility results collection response model. ReplicationEligibilityResultsCollection } // ReplicationEventsClientGetResponse contains the response from method ReplicationEventsClient.Get. type ReplicationEventsClientGetResponse struct { + // Implements the Event class. Event } // ReplicationEventsClientListResponse contains the response from method ReplicationEventsClient.NewListPager. type ReplicationEventsClientListResponse struct { + // Collection of fabric details. EventCollection } // ReplicationFabricsClientCheckConsistencyResponse contains the response from method ReplicationFabricsClient.BeginCheckConsistency. type ReplicationFabricsClientCheckConsistencyResponse struct { + // Fabric definition. Fabric } // ReplicationFabricsClientCreateResponse contains the response from method ReplicationFabricsClient.BeginCreate. type ReplicationFabricsClientCreateResponse struct { + // Fabric definition. Fabric } @@ -91,11 +105,13 @@ type ReplicationFabricsClientDeleteResponse struct { // ReplicationFabricsClientGetResponse contains the response from method ReplicationFabricsClient.Get. type ReplicationFabricsClientGetResponse struct { + // Fabric definition. Fabric } // ReplicationFabricsClientListResponse contains the response from method ReplicationFabricsClient.NewListPager. type ReplicationFabricsClientListResponse struct { + // Collection of fabric details. FabricCollection } @@ -111,56 +127,67 @@ type ReplicationFabricsClientPurgeResponse struct { // ReplicationFabricsClientReassociateGatewayResponse contains the response from method ReplicationFabricsClient.BeginReassociateGateway. type ReplicationFabricsClientReassociateGatewayResponse struct { + // Fabric definition. Fabric } // ReplicationFabricsClientRenewCertificateResponse contains the response from method ReplicationFabricsClient.BeginRenewCertificate. type ReplicationFabricsClientRenewCertificateResponse struct { + // Fabric definition. Fabric } // ReplicationJobsClientCancelResponse contains the response from method ReplicationJobsClient.BeginCancel. type ReplicationJobsClientCancelResponse struct { + // Job details. Job } // ReplicationJobsClientExportResponse contains the response from method ReplicationJobsClient.BeginExport. type ReplicationJobsClientExportResponse struct { + // Job details. Job } // ReplicationJobsClientGetResponse contains the response from method ReplicationJobsClient.Get. type ReplicationJobsClientGetResponse struct { + // Job details. Job } // ReplicationJobsClientListResponse contains the response from method ReplicationJobsClient.NewListPager. type ReplicationJobsClientListResponse struct { + // Collection of jobs. JobCollection } // ReplicationJobsClientRestartResponse contains the response from method ReplicationJobsClient.BeginRestart. type ReplicationJobsClientRestartResponse struct { + // Job details. Job } // ReplicationJobsClientResumeResponse contains the response from method ReplicationJobsClient.BeginResume. type ReplicationJobsClientResumeResponse struct { + // Job details. Job } // ReplicationLogicalNetworksClientGetResponse contains the response from method ReplicationLogicalNetworksClient.Get. type ReplicationLogicalNetworksClientGetResponse struct { + // Logical network data model. LogicalNetwork } // ReplicationLogicalNetworksClientListByReplicationFabricsResponse contains the response from method ReplicationLogicalNetworksClient.NewListByReplicationFabricsPager. type ReplicationLogicalNetworksClientListByReplicationFabricsResponse struct { + // List of logical networks. LogicalNetworkCollection } // ReplicationMigrationItemsClientCreateResponse contains the response from method ReplicationMigrationItemsClient.BeginCreate. type ReplicationMigrationItemsClientCreateResponse struct { + // Migration item. MigrationItem } @@ -171,56 +198,70 @@ type ReplicationMigrationItemsClientDeleteResponse struct { // ReplicationMigrationItemsClientGetResponse contains the response from method ReplicationMigrationItemsClient.Get. type ReplicationMigrationItemsClientGetResponse struct { + // Migration item. MigrationItem } // ReplicationMigrationItemsClientListByReplicationProtectionContainersResponse contains the response from method ReplicationMigrationItemsClient.NewListByReplicationProtectionContainersPager. type ReplicationMigrationItemsClientListByReplicationProtectionContainersResponse struct { + // Migration item collection. MigrationItemCollection } // ReplicationMigrationItemsClientListResponse contains the response from method ReplicationMigrationItemsClient.NewListPager. type ReplicationMigrationItemsClientListResponse struct { + // Migration item collection. MigrationItemCollection } // ReplicationMigrationItemsClientMigrateResponse contains the response from method ReplicationMigrationItemsClient.BeginMigrate. type ReplicationMigrationItemsClientMigrateResponse struct { + // Migration item. MigrationItem } // ReplicationMigrationItemsClientPauseReplicationResponse contains the response from method ReplicationMigrationItemsClient.BeginPauseReplication. type ReplicationMigrationItemsClientPauseReplicationResponse struct { + // Migration item. MigrationItem } // ReplicationMigrationItemsClientResumeReplicationResponse contains the response from method ReplicationMigrationItemsClient.BeginResumeReplication. type ReplicationMigrationItemsClientResumeReplicationResponse struct { + // Migration item. MigrationItem } // ReplicationMigrationItemsClientResyncResponse contains the response from method ReplicationMigrationItemsClient.BeginResync. type ReplicationMigrationItemsClientResyncResponse struct { + // Migration item. MigrationItem } // ReplicationMigrationItemsClientTestMigrateCleanupResponse contains the response from method ReplicationMigrationItemsClient.BeginTestMigrateCleanup. type ReplicationMigrationItemsClientTestMigrateCleanupResponse struct { + // Migration item. MigrationItem } // ReplicationMigrationItemsClientTestMigrateResponse contains the response from method ReplicationMigrationItemsClient.BeginTestMigrate. type ReplicationMigrationItemsClientTestMigrateResponse struct { + // Migration item. MigrationItem } // ReplicationMigrationItemsClientUpdateResponse contains the response from method ReplicationMigrationItemsClient.BeginUpdate. type ReplicationMigrationItemsClientUpdateResponse struct { + // Migration item. MigrationItem } // ReplicationNetworkMappingsClientCreateResponse contains the response from method ReplicationNetworkMappingsClient.BeginCreate. type ReplicationNetworkMappingsClientCreateResponse struct { + // Network Mapping model. Ideally it should have been possible to inherit this class from prev version in InheritedModels + // as long as there is no difference in structure or method signature. Since there were no base Models for certain fields + // and methods viz NetworkMappingProperties and Load with required return type, the class has been introduced in its entirety + // with references to base models to facilitate extensions in subsequent versions. NetworkMapping } @@ -231,41 +272,59 @@ type ReplicationNetworkMappingsClientDeleteResponse struct { // ReplicationNetworkMappingsClientGetResponse contains the response from method ReplicationNetworkMappingsClient.Get. type ReplicationNetworkMappingsClientGetResponse struct { + // Network Mapping model. Ideally it should have been possible to inherit this class from prev version in InheritedModels + // as long as there is no difference in structure or method signature. Since there were no base Models for certain fields + // and methods viz NetworkMappingProperties and Load with required return type, the class has been introduced in its entirety + // with references to base models to facilitate extensions in subsequent versions. NetworkMapping } // ReplicationNetworkMappingsClientListByReplicationNetworksResponse contains the response from method ReplicationNetworkMappingsClient.NewListByReplicationNetworksPager. type ReplicationNetworkMappingsClientListByReplicationNetworksResponse struct { + // List of network mappings. As with NetworkMapping, it should be possible to reuse a prev version of this class. It doesn't + // seem likely this class could be anything more than a slightly bespoke collection of NetworkMapping. Hence it makes sense + // to override Load with Base.NetworkMapping instead of existing CurrentVersion.NetworkMapping. NetworkMappingCollection } // ReplicationNetworkMappingsClientListResponse contains the response from method ReplicationNetworkMappingsClient.NewListPager. type ReplicationNetworkMappingsClientListResponse struct { + // List of network mappings. As with NetworkMapping, it should be possible to reuse a prev version of this class. It doesn't + // seem likely this class could be anything more than a slightly bespoke collection of NetworkMapping. Hence it makes sense + // to override Load with Base.NetworkMapping instead of existing CurrentVersion.NetworkMapping. NetworkMappingCollection } // ReplicationNetworkMappingsClientUpdateResponse contains the response from method ReplicationNetworkMappingsClient.BeginUpdate. type ReplicationNetworkMappingsClientUpdateResponse struct { + // Network Mapping model. Ideally it should have been possible to inherit this class from prev version in InheritedModels + // as long as there is no difference in structure or method signature. Since there were no base Models for certain fields + // and methods viz NetworkMappingProperties and Load with required return type, the class has been introduced in its entirety + // with references to base models to facilitate extensions in subsequent versions. NetworkMapping } // ReplicationNetworksClientGetResponse contains the response from method ReplicationNetworksClient.Get. type ReplicationNetworksClientGetResponse struct { + // Network model. Network } // ReplicationNetworksClientListByReplicationFabricsResponse contains the response from method ReplicationNetworksClient.NewListByReplicationFabricsPager. type ReplicationNetworksClientListByReplicationFabricsResponse struct { + // List of networks. NetworkCollection } // ReplicationNetworksClientListResponse contains the response from method ReplicationNetworksClient.NewListPager. type ReplicationNetworksClientListResponse struct { + // List of networks. NetworkCollection } // ReplicationPoliciesClientCreateResponse contains the response from method ReplicationPoliciesClient.BeginCreate. type ReplicationPoliciesClientCreateResponse struct { + // Protection profile details. Policy } @@ -276,41 +335,49 @@ type ReplicationPoliciesClientDeleteResponse struct { // ReplicationPoliciesClientGetResponse contains the response from method ReplicationPoliciesClient.Get. type ReplicationPoliciesClientGetResponse struct { + // Protection profile details. Policy } // ReplicationPoliciesClientListResponse contains the response from method ReplicationPoliciesClient.NewListPager. type ReplicationPoliciesClientListResponse struct { + // Protection Profile Collection details. PolicyCollection } // ReplicationPoliciesClientUpdateResponse contains the response from method ReplicationPoliciesClient.BeginUpdate. type ReplicationPoliciesClientUpdateResponse struct { + // Protection profile details. Policy } // ReplicationProtectableItemsClientGetResponse contains the response from method ReplicationProtectableItemsClient.Get. type ReplicationProtectableItemsClientGetResponse struct { + // Replication protected item. ProtectableItem } // ReplicationProtectableItemsClientListByReplicationProtectionContainersResponse contains the response from method ReplicationProtectableItemsClient.NewListByReplicationProtectionContainersPager. type ReplicationProtectableItemsClientListByReplicationProtectionContainersResponse struct { + // Protectable item collection. ProtectableItemCollection } // ReplicationProtectedItemsClientAddDisksResponse contains the response from method ReplicationProtectedItemsClient.BeginAddDisks. type ReplicationProtectedItemsClientAddDisksResponse struct { + // Replication protected item. ReplicationProtectedItem } // ReplicationProtectedItemsClientApplyRecoveryPointResponse contains the response from method ReplicationProtectedItemsClient.BeginApplyRecoveryPoint. type ReplicationProtectedItemsClientApplyRecoveryPointResponse struct { + // Replication protected item. ReplicationProtectedItem } // ReplicationProtectedItemsClientCreateResponse contains the response from method ReplicationProtectedItemsClient.BeginCreate. type ReplicationProtectedItemsClientCreateResponse struct { + // Replication protected item. ReplicationProtectedItem } @@ -321,31 +388,37 @@ type ReplicationProtectedItemsClientDeleteResponse struct { // ReplicationProtectedItemsClientFailoverCancelResponse contains the response from method ReplicationProtectedItemsClient.BeginFailoverCancel. type ReplicationProtectedItemsClientFailoverCancelResponse struct { + // Replication protected item. ReplicationProtectedItem } // ReplicationProtectedItemsClientFailoverCommitResponse contains the response from method ReplicationProtectedItemsClient.BeginFailoverCommit. type ReplicationProtectedItemsClientFailoverCommitResponse struct { + // Replication protected item. ReplicationProtectedItem } // ReplicationProtectedItemsClientGetResponse contains the response from method ReplicationProtectedItemsClient.Get. type ReplicationProtectedItemsClientGetResponse struct { + // Replication protected item. ReplicationProtectedItem } // ReplicationProtectedItemsClientListByReplicationProtectionContainersResponse contains the response from method ReplicationProtectedItemsClient.NewListByReplicationProtectionContainersPager. type ReplicationProtectedItemsClientListByReplicationProtectionContainersResponse struct { + // Replication protected item collection. ReplicationProtectedItemCollection } // ReplicationProtectedItemsClientListResponse contains the response from method ReplicationProtectedItemsClient.NewListPager. type ReplicationProtectedItemsClientListResponse struct { + // Replication protected item collection. ReplicationProtectedItemCollection } // ReplicationProtectedItemsClientPlannedFailoverResponse contains the response from method ReplicationProtectedItemsClient.BeginPlannedFailover. type ReplicationProtectedItemsClientPlannedFailoverResponse struct { + // Replication protected item. ReplicationProtectedItem } @@ -356,61 +429,73 @@ type ReplicationProtectedItemsClientPurgeResponse struct { // ReplicationProtectedItemsClientRemoveDisksResponse contains the response from method ReplicationProtectedItemsClient.BeginRemoveDisks. type ReplicationProtectedItemsClientRemoveDisksResponse struct { + // Replication protected item. ReplicationProtectedItem } // ReplicationProtectedItemsClientRepairReplicationResponse contains the response from method ReplicationProtectedItemsClient.BeginRepairReplication. type ReplicationProtectedItemsClientRepairReplicationResponse struct { + // Replication protected item. ReplicationProtectedItem } // ReplicationProtectedItemsClientReprotectResponse contains the response from method ReplicationProtectedItemsClient.BeginReprotect. type ReplicationProtectedItemsClientReprotectResponse struct { + // Replication protected item. ReplicationProtectedItem } // ReplicationProtectedItemsClientResolveHealthErrorsResponse contains the response from method ReplicationProtectedItemsClient.BeginResolveHealthErrors. type ReplicationProtectedItemsClientResolveHealthErrorsResponse struct { + // Replication protected item. ReplicationProtectedItem } // ReplicationProtectedItemsClientSwitchProviderResponse contains the response from method ReplicationProtectedItemsClient.BeginSwitchProvider. type ReplicationProtectedItemsClientSwitchProviderResponse struct { + // Replication protected item. ReplicationProtectedItem } // ReplicationProtectedItemsClientTestFailoverCleanupResponse contains the response from method ReplicationProtectedItemsClient.BeginTestFailoverCleanup. type ReplicationProtectedItemsClientTestFailoverCleanupResponse struct { + // Replication protected item. ReplicationProtectedItem } // ReplicationProtectedItemsClientTestFailoverResponse contains the response from method ReplicationProtectedItemsClient.BeginTestFailover. type ReplicationProtectedItemsClientTestFailoverResponse struct { + // Replication protected item. ReplicationProtectedItem } // ReplicationProtectedItemsClientUnplannedFailoverResponse contains the response from method ReplicationProtectedItemsClient.BeginUnplannedFailover. type ReplicationProtectedItemsClientUnplannedFailoverResponse struct { + // Replication protected item. ReplicationProtectedItem } // ReplicationProtectedItemsClientUpdateApplianceResponse contains the response from method ReplicationProtectedItemsClient.BeginUpdateAppliance. type ReplicationProtectedItemsClientUpdateApplianceResponse struct { + // Replication protected item. ReplicationProtectedItem } // ReplicationProtectedItemsClientUpdateMobilityServiceResponse contains the response from method ReplicationProtectedItemsClient.BeginUpdateMobilityService. type ReplicationProtectedItemsClientUpdateMobilityServiceResponse struct { + // Replication protected item. ReplicationProtectedItem } // ReplicationProtectedItemsClientUpdateResponse contains the response from method ReplicationProtectedItemsClient.BeginUpdate. type ReplicationProtectedItemsClientUpdateResponse struct { + // Replication protected item. ReplicationProtectedItem } // ReplicationProtectionContainerMappingsClientCreateResponse contains the response from method ReplicationProtectionContainerMappingsClient.BeginCreate. type ReplicationProtectionContainerMappingsClientCreateResponse struct { + // Protection container mapping object. ProtectionContainerMapping } @@ -421,17 +506,20 @@ type ReplicationProtectionContainerMappingsClientDeleteResponse struct { // ReplicationProtectionContainerMappingsClientGetResponse contains the response from method ReplicationProtectionContainerMappingsClient.Get. type ReplicationProtectionContainerMappingsClientGetResponse struct { + // Protection container mapping object. ProtectionContainerMapping } // ReplicationProtectionContainerMappingsClientListByReplicationProtectionContainersResponse contains the response from method // ReplicationProtectionContainerMappingsClient.NewListByReplicationProtectionContainersPager. type ReplicationProtectionContainerMappingsClientListByReplicationProtectionContainersResponse struct { + // Protection container mapping collection class. ProtectionContainerMappingCollection } // ReplicationProtectionContainerMappingsClientListResponse contains the response from method ReplicationProtectionContainerMappingsClient.NewListPager. type ReplicationProtectionContainerMappingsClientListResponse struct { + // Protection container mapping collection class. ProtectionContainerMappingCollection } @@ -442,11 +530,13 @@ type ReplicationProtectionContainerMappingsClientPurgeResponse struct { // ReplicationProtectionContainerMappingsClientUpdateResponse contains the response from method ReplicationProtectionContainerMappingsClient.BeginUpdate. type ReplicationProtectionContainerMappingsClientUpdateResponse struct { + // Protection container mapping object. ProtectionContainerMapping } // ReplicationProtectionContainersClientCreateResponse contains the response from method ReplicationProtectionContainersClient.BeginCreate. type ReplicationProtectionContainersClientCreateResponse struct { + // Protection container details. ProtectionContainer } @@ -457,46 +547,55 @@ type ReplicationProtectionContainersClientDeleteResponse struct { // ReplicationProtectionContainersClientDiscoverProtectableItemResponse contains the response from method ReplicationProtectionContainersClient.BeginDiscoverProtectableItem. type ReplicationProtectionContainersClientDiscoverProtectableItemResponse struct { + // Protection container details. ProtectionContainer } // ReplicationProtectionContainersClientGetResponse contains the response from method ReplicationProtectionContainersClient.Get. type ReplicationProtectionContainersClientGetResponse struct { + // Protection container details. ProtectionContainer } // ReplicationProtectionContainersClientListByReplicationFabricsResponse contains the response from method ReplicationProtectionContainersClient.NewListByReplicationFabricsPager. type ReplicationProtectionContainersClientListByReplicationFabricsResponse struct { + // Protection Container collection. ProtectionContainerCollection } // ReplicationProtectionContainersClientListResponse contains the response from method ReplicationProtectionContainersClient.NewListPager. type ReplicationProtectionContainersClientListResponse struct { + // Protection Container collection. ProtectionContainerCollection } // ReplicationProtectionContainersClientSwitchProtectionResponse contains the response from method ReplicationProtectionContainersClient.BeginSwitchProtection. type ReplicationProtectionContainersClientSwitchProtectionResponse struct { + // Protection container details. ProtectionContainer } // ReplicationProtectionIntentsClientCreateResponse contains the response from method ReplicationProtectionIntentsClient.Create. type ReplicationProtectionIntentsClientCreateResponse struct { + // Replication protection intent. ReplicationProtectionIntent } // ReplicationProtectionIntentsClientGetResponse contains the response from method ReplicationProtectionIntentsClient.Get. type ReplicationProtectionIntentsClientGetResponse struct { + // Replication protection intent. ReplicationProtectionIntent } // ReplicationProtectionIntentsClientListResponse contains the response from method ReplicationProtectionIntentsClient.NewListPager. type ReplicationProtectionIntentsClientListResponse struct { + // Replication protection intent objects collection. ReplicationProtectionIntentCollection } // ReplicationRecoveryPlansClientCreateResponse contains the response from method ReplicationRecoveryPlansClient.BeginCreate. type ReplicationRecoveryPlansClientCreateResponse struct { + // Recovery plan details. RecoveryPlan } @@ -507,56 +606,67 @@ type ReplicationRecoveryPlansClientDeleteResponse struct { // ReplicationRecoveryPlansClientFailoverCancelResponse contains the response from method ReplicationRecoveryPlansClient.BeginFailoverCancel. type ReplicationRecoveryPlansClientFailoverCancelResponse struct { + // Recovery plan details. RecoveryPlan } // ReplicationRecoveryPlansClientFailoverCommitResponse contains the response from method ReplicationRecoveryPlansClient.BeginFailoverCommit. type ReplicationRecoveryPlansClientFailoverCommitResponse struct { + // Recovery plan details. RecoveryPlan } // ReplicationRecoveryPlansClientGetResponse contains the response from method ReplicationRecoveryPlansClient.Get. type ReplicationRecoveryPlansClientGetResponse struct { + // Recovery plan details. RecoveryPlan } // ReplicationRecoveryPlansClientListResponse contains the response from method ReplicationRecoveryPlansClient.NewListPager. type ReplicationRecoveryPlansClientListResponse struct { + // Recovery plan collection details. RecoveryPlanCollection } // ReplicationRecoveryPlansClientPlannedFailoverResponse contains the response from method ReplicationRecoveryPlansClient.BeginPlannedFailover. type ReplicationRecoveryPlansClientPlannedFailoverResponse struct { + // Recovery plan details. RecoveryPlan } // ReplicationRecoveryPlansClientReprotectResponse contains the response from method ReplicationRecoveryPlansClient.BeginReprotect. type ReplicationRecoveryPlansClientReprotectResponse struct { + // Recovery plan details. RecoveryPlan } // ReplicationRecoveryPlansClientTestFailoverCleanupResponse contains the response from method ReplicationRecoveryPlansClient.BeginTestFailoverCleanup. type ReplicationRecoveryPlansClientTestFailoverCleanupResponse struct { + // Recovery plan details. RecoveryPlan } // ReplicationRecoveryPlansClientTestFailoverResponse contains the response from method ReplicationRecoveryPlansClient.BeginTestFailover. type ReplicationRecoveryPlansClientTestFailoverResponse struct { + // Recovery plan details. RecoveryPlan } // ReplicationRecoveryPlansClientUnplannedFailoverResponse contains the response from method ReplicationRecoveryPlansClient.BeginUnplannedFailover. type ReplicationRecoveryPlansClientUnplannedFailoverResponse struct { + // Recovery plan details. RecoveryPlan } // ReplicationRecoveryPlansClientUpdateResponse contains the response from method ReplicationRecoveryPlansClient.BeginUpdate. type ReplicationRecoveryPlansClientUpdateResponse struct { + // Recovery plan details. RecoveryPlan } // ReplicationRecoveryServicesProvidersClientCreateResponse contains the response from method ReplicationRecoveryServicesProvidersClient.BeginCreate. type ReplicationRecoveryServicesProvidersClientCreateResponse struct { + // Provider details. RecoveryServicesProvider } @@ -567,16 +677,19 @@ type ReplicationRecoveryServicesProvidersClientDeleteResponse struct { // ReplicationRecoveryServicesProvidersClientGetResponse contains the response from method ReplicationRecoveryServicesProvidersClient.Get. type ReplicationRecoveryServicesProvidersClientGetResponse struct { + // Provider details. RecoveryServicesProvider } // ReplicationRecoveryServicesProvidersClientListByReplicationFabricsResponse contains the response from method ReplicationRecoveryServicesProvidersClient.NewListByReplicationFabricsPager. type ReplicationRecoveryServicesProvidersClientListByReplicationFabricsResponse struct { + // Collection of providers. RecoveryServicesProviderCollection } // ReplicationRecoveryServicesProvidersClientListResponse contains the response from method ReplicationRecoveryServicesProvidersClient.NewListPager. type ReplicationRecoveryServicesProvidersClientListResponse struct { + // Collection of providers. RecoveryServicesProviderCollection } @@ -587,11 +700,13 @@ type ReplicationRecoveryServicesProvidersClientPurgeResponse struct { // ReplicationRecoveryServicesProvidersClientRefreshProviderResponse contains the response from method ReplicationRecoveryServicesProvidersClient.BeginRefreshProvider. type ReplicationRecoveryServicesProvidersClientRefreshProviderResponse struct { + // Provider details. RecoveryServicesProvider } // ReplicationStorageClassificationMappingsClientCreateResponse contains the response from method ReplicationStorageClassificationMappingsClient.BeginCreate. type ReplicationStorageClassificationMappingsClientCreateResponse struct { + // Storage mapping object. StorageClassificationMapping } @@ -602,62 +717,74 @@ type ReplicationStorageClassificationMappingsClientDeleteResponse struct { // ReplicationStorageClassificationMappingsClientGetResponse contains the response from method ReplicationStorageClassificationMappingsClient.Get. type ReplicationStorageClassificationMappingsClientGetResponse struct { + // Storage mapping object. StorageClassificationMapping } // ReplicationStorageClassificationMappingsClientListByReplicationStorageClassificationsResponse contains the response from // method ReplicationStorageClassificationMappingsClient.NewListByReplicationStorageClassificationsPager. type ReplicationStorageClassificationMappingsClientListByReplicationStorageClassificationsResponse struct { + // Collection of storage mapping details. StorageClassificationMappingCollection } // ReplicationStorageClassificationMappingsClientListResponse contains the response from method ReplicationStorageClassificationMappingsClient.NewListPager. type ReplicationStorageClassificationMappingsClientListResponse struct { + // Collection of storage mapping details. StorageClassificationMappingCollection } // ReplicationStorageClassificationsClientGetResponse contains the response from method ReplicationStorageClassificationsClient.Get. type ReplicationStorageClassificationsClientGetResponse struct { + // Storage object definition. StorageClassification } // ReplicationStorageClassificationsClientListByReplicationFabricsResponse contains the response from method ReplicationStorageClassificationsClient.NewListByReplicationFabricsPager. type ReplicationStorageClassificationsClientListByReplicationFabricsResponse struct { + // Collection of storage details. StorageClassificationCollection } // ReplicationStorageClassificationsClientListResponse contains the response from method ReplicationStorageClassificationsClient.NewListPager. type ReplicationStorageClassificationsClientListResponse struct { + // Collection of storage details. StorageClassificationCollection } // ReplicationVaultHealthClientGetResponse contains the response from method ReplicationVaultHealthClient.Get. type ReplicationVaultHealthClientGetResponse struct { + // Vault health details definition. VaultHealthDetails } // ReplicationVaultHealthClientRefreshResponse contains the response from method ReplicationVaultHealthClient.BeginRefresh. type ReplicationVaultHealthClientRefreshResponse struct { + // Vault health details definition. VaultHealthDetails } // ReplicationVaultSettingClientCreateResponse contains the response from method ReplicationVaultSettingClient.BeginCreate. type ReplicationVaultSettingClientCreateResponse struct { + // Vault setting. VaultSetting } // ReplicationVaultSettingClientGetResponse contains the response from method ReplicationVaultSettingClient.Get. type ReplicationVaultSettingClientGetResponse struct { + // Vault setting. VaultSetting } // ReplicationVaultSettingClientListResponse contains the response from method ReplicationVaultSettingClient.NewListPager. type ReplicationVaultSettingClientListResponse struct { + // Vault setting collection. VaultSettingCollection } // ReplicationvCentersClientCreateResponse contains the response from method ReplicationvCentersClient.BeginCreate. type ReplicationvCentersClientCreateResponse struct { + // vCenter definition. VCenter } @@ -668,30 +795,36 @@ type ReplicationvCentersClientDeleteResponse struct { // ReplicationvCentersClientGetResponse contains the response from method ReplicationvCentersClient.Get. type ReplicationvCentersClientGetResponse struct { + // vCenter definition. VCenter } // ReplicationvCentersClientListByReplicationFabricsResponse contains the response from method ReplicationvCentersClient.NewListByReplicationFabricsPager. type ReplicationvCentersClientListByReplicationFabricsResponse struct { + // Collection of vCenter details. VCenterCollection } // ReplicationvCentersClientListResponse contains the response from method ReplicationvCentersClient.NewListPager. type ReplicationvCentersClientListResponse struct { + // Collection of vCenter details. VCenterCollection } // ReplicationvCentersClientUpdateResponse contains the response from method ReplicationvCentersClient.BeginUpdate. type ReplicationvCentersClientUpdateResponse struct { + // vCenter definition. VCenter } // SupportedOperatingSystemsClientGetResponse contains the response from method SupportedOperatingSystemsClient.Get. type SupportedOperatingSystemsClientGetResponse struct { + // Supported operating systems. SupportedOperatingSystems } // TargetComputeSizesClientListByReplicationProtectedItemsResponse contains the response from method TargetComputeSizesClient.NewListByReplicationProtectedItemsPager. type TargetComputeSizesClientListByReplicationProtectedItemsResponse struct { + // Target compute size collection. TargetComputeSizeCollection } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/supportedoperatingsystems_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/supportedoperatingsystems_client.go index e68f72fde82b..8a30973ace78 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/supportedoperatingsystems_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/supportedoperatingsystems_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -47,24 +46,27 @@ func NewSupportedOperatingSystemsClient(subscriptionID string, credential azcore // Get - Gets the data of supported operating systems by SRS. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - SupportedOperatingSystemsClientGetOptions contains the optional parameters for the SupportedOperatingSystemsClient.Get // method. func (client *SupportedOperatingSystemsClient) Get(ctx context.Context, resourceName string, resourceGroupName string, options *SupportedOperatingSystemsClientGetOptions) (SupportedOperatingSystemsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, options) if err != nil { return SupportedOperatingSystemsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SupportedOperatingSystemsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SupportedOperatingSystemsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SupportedOperatingSystemsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -87,7 +89,7 @@ func (client *SupportedOperatingSystemsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") if options != nil && options.InstanceType != nil { reqQP.Set("instanceType", *options.InstanceType) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/supportedoperatingsystems_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/supportedoperatingsystems_client_example_test.go deleted file mode 100644 index 8c5d80cd4757..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/supportedoperatingsystems_client_example_test.go +++ /dev/null @@ -1,67 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/SupportedOperatingSystems_Get.json -func ExampleSupportedOperatingSystemsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSupportedOperatingSystemsClient().Get(ctx, "vault1", "resourceGroupPS1", &armrecoveryservicessiterecovery.SupportedOperatingSystemsClientGetOptions{InstanceType: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SupportedOperatingSystems = armrecoveryservicessiterecovery.SupportedOperatingSystems{ - // Name: to.Ptr("Default"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationSupportedOperatingSystems"), - // ID: to.Ptr("/Subscriptions/bc403605-c2b0-43dd-abe9-0162124b1ee1/resourceGroups/oneBoxRG/providers/Microsoft.RecoveryServices/vaults/oneBoxRSVault/replicationSupportedOperatingSystems/Default"), - // Properties: &armrecoveryservicessiterecovery.SupportedOSProperties{ - // SupportedOsList: []*armrecoveryservicessiterecovery.SupportedOSProperty{ - // { - // InstanceType: to.Ptr("A2A"), - // SupportedOs: []*armrecoveryservicessiterecovery.SupportedOSDetails{ - // { - // OSName: to.Ptr("centos"), - // OSType: to.Ptr("linux"), - // OSVersions: []*armrecoveryservicessiterecovery.OSVersionWrapper{ - // { - // Version: to.Ptr("6.0"), - // }}, - // }, - // { - // OSName: to.Ptr("Windows Server 2008 R2 Datacenter"), - // OSType: to.Ptr("windows"), - // OSVersions: []*armrecoveryservicessiterecovery.OSVersionWrapper{ - // { - // ServicePack: to.Ptr("1"), - // Version: to.Ptr("6.1"), - // }}, - // }}, - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/targetcomputesizes_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/targetcomputesizes_client.go index c1b63800fef0..24939a5c3db9 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/targetcomputesizes_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/targetcomputesizes_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery @@ -46,7 +45,7 @@ func NewTargetComputeSizesClient(subscriptionID string, credential azcore.TokenC // NewListByReplicationProtectedItemsPager - Lists the available target compute sizes for a replication protected item. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-06-01 // - resourceName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name. @@ -114,7 +113,7 @@ func (client *TargetComputeSizesClient) listByReplicationProtectedItemsCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/targetcomputesizes_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/targetcomputesizes_client_example_test.go deleted file mode 100644 index ab9888faab48..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/targetcomputesizes_client_example_test.go +++ /dev/null @@ -1,77 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicessiterecovery_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/TargetComputeSizes_ListByReplicationProtectedItems.json -func ExampleTargetComputeSizesClient_NewListByReplicationProtectedItemsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTargetComputeSizesClient().NewListByReplicationProtectedItemsPager("avraiMgDiskVault", "avraiMgDiskVaultRG", "asr-a2a-default-centraluseuap", "asr-a2a-default-centraluseuap-container", "468c912d-b1ab-4ea2-97eb-4b5095155db2", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TargetComputeSizeCollection = armrecoveryservicessiterecovery.TargetComputeSizeCollection{ - // Value: []*armrecoveryservicessiterecovery.TargetComputeSize{ - // { - // Name: to.Ptr("Basic_A0"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/targetComputeSizes"), - // ID: to.Ptr("/Subscriptions/6808dbbc-98c7-431f-a1b1-9580902423b7/resourceGroups/avraiMgDiskVaultRG/providers/Microsoft.RecoveryServices/vaults/avraiMgDiskVault/replicationFabrics/asr-a2a-default-centraluseuap/replicationProtectionContainers/asr-a2a-default-centraluseuap-container/replicationProtectedItems/468c912d-b1ab-4ea2-97eb-4b5095155db2/targetComputeSizes/Basic_A0"), - // Properties: &armrecoveryservicessiterecovery.TargetComputeSizeProperties{ - // Name: to.Ptr("Basic_A0"), - // CPUCoresCount: to.Ptr[int32](1), - // FriendlyName: to.Ptr("Basic_A0"), - // HighIopsSupported: to.Ptr("NotSupported"), - // MaxDataDiskCount: to.Ptr[int32](1), - // MaxNicsCount: to.Ptr[int32](2), - // MemoryInGB: to.Ptr[float64](0.75), - // }, - // }, - // { - // Name: to.Ptr("Standard_A0"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems/targetComputeSizes"), - // ID: to.Ptr("/Subscriptions/6808dbbc-98c7-431f-a1b1-9580902423b7/resourceGroups/avraiMgDiskVaultRG/providers/Microsoft.RecoveryServices/vaults/avraiMgDiskVault/replicationFabrics/asr-a2a-default-centraluseuap/replicationProtectionContainers/asr-a2a-default-centraluseuap-container/replicationProtectedItems/468c912d-b1ab-4ea2-97eb-4b5095155db2/targetComputeSizes/Standard_A0"), - // Properties: &armrecoveryservicessiterecovery.TargetComputeSizeProperties{ - // Name: to.Ptr("Standard_A0"), - // CPUCoresCount: to.Ptr[int32](1), - // FriendlyName: to.Ptr("Standard_A0"), - // HighIopsSupported: to.Ptr("NotSupported"), - // HyperVGenerations: []*string{ - // to.Ptr("V1")}, - // MaxDataDiskCount: to.Ptr[int32](1), - // MaxNicsCount: to.Ptr[int32](2), - // MemoryInGB: to.Ptr[float64](0.75), - // VCPUsAvailable: to.Ptr[int32](1), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/time_rfc3339.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/time_rfc3339.go index a693c786988b..c758b9e62587 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/time_rfc3339.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/time_rfc3339.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicessiterecovery