From 33c42dd14e30ddf9f6525e2121450f09449de73d Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 24 Dec 2024 11:25:46 +0000 Subject: [PATCH] CodeGen from PR 31514 in Azure/azure-rest-api-specs Merge b349662625294e749f325363f04867972ee81ca6 into 64f6997950d8bee63f314563cedaa20148db2186 --- .../CHANGELOG.md | 112 + .../armrecoveryservicessiterecovery/README.md | 2 +- .../autorest.md | 7 +- .../client_factory.go | 24 + .../clusterrecoverypoint_client.go | 129 + .../clusterrecoverypoints_client.go | 124 + .../constants.go | 100 +- .../fake/clusterrecoverypoint_server.go | 116 + .../fake/clusterrecoverypoints_server.go | 124 + .../fake/migrationrecoverypoints_server.go | 16 +- .../fake/recoverypoints_server.go | 16 +- .../fake/replicationalertsettings_server.go | 24 +- .../fake/replicationappliances_server.go | 8 +- .../fake/replicationevents_server.go | 16 +- .../fake/replicationfabrics_server.go | 72 +- .../fake/replicationjobs_server.go | 48 +- .../fake/replicationlogicalnetworks_server.go | 16 +- .../fake/replicationmigrationitems_server.go | 96 +- .../fake/replicationnetworkmappings_server.go | 48 +- .../fake/replicationnetworks_server.go | 24 +- .../fake/replicationpolicies_server.go | 40 +- .../replicationprotectableitems_server.go | 16 +- .../fake/replicationprotecteditems_server.go | 176 +- .../replicationprotectionclusters_server.go | 826 +++++++ ...ationprotectioncontainermappings_server.go | 56 +- .../replicationprotectioncontainers_server.go | 120 +- .../replicationprotectionintents_server.go | 24 +- .../fake/replicationrecoveryplans_server.go | 96 +- ...icationrecoveryservicesproviders_server.go | 56 +- ...ionstorageclassificationmappings_server.go | 40 +- ...eplicationstorageclassifications_server.go | 24 +- .../fake/replicationvaulthealth_server.go | 16 +- .../fake/replicationvaultsetting_server.go | 24 +- .../fake/replicationvcenters_server.go | 48 +- .../fake/server_factory.go | 21 + .../fake/supportedoperatingsystems_server.go | 8 +- .../fake/targetcomputesizes_server.go | 8 +- .../armrecoveryservicessiterecovery/go.mod | 12 +- .../armrecoveryservicessiterecovery/go.sum | 23 - .../interfaces.go | 68 +- .../migrationrecoverypoints_client.go | 40 +- ...ationrecoverypoints_client_example_test.go | 93 - .../armrecoveryservicessiterecovery/models.go | 1038 +++++++- .../models_serde.go | 2170 ++++++++++++++++- .../operations_client.go | 4 +- .../operations_client_example_test.go | 1256 ---------- .../options.go | 102 + .../polymorphic_helpers.go | 155 ++ .../recoverypoints_client.go | 40 +- .../recoverypoints_client_example_test.go | 93 - .../replicationalertsettings_client.go | 60 +- ...cationalertsettings_client_example_test.go | 127 - .../replicationappliances_client.go | 20 +- ...plicationappliances_client_example_test.go | 55 - .../replicationeligibilityresults_client.go | 8 +- ...neligibilityresults_client_example_test.go | 100 - .../replicationevents_client.go | 40 +- .../replicationevents_client_example_test.go | 137 -- .../replicationfabrics_client.go | 228 +- .../replicationfabrics_client_example_test.go | 399 --- .../replicationjobs_client.go | 144 +- .../replicationjobs_client_example_test.go | 452 ---- .../replicationlogicalnetworks_client.go | 40 +- ...tionlogicalnetworks_client_example_test.go | 99 - .../replicationmigrationitems_client.go | 294 +-- ...ationmigrationitems_client_example_test.go | 667 ----- .../replicationnetworkmappings_client.go | 138 +- ...tionnetworkmappings_client_example_test.go | 270 -- .../replicationnetworks_client.go | 60 +- ...replicationnetworks_client_example_test.go | 178 -- .../replicationpolicies_client.go | 118 +- ...replicationpolicies_client_example_test.go | 192 -- .../replicationprotectableitems_client.go | 40 +- ...ionprotectableitems_client_example_test.go | 120 - .../replicationprotecteditems_client.go | 554 ++--- ...ationprotecteditems_client_example_test.go | 1464 ----------- .../replicationprotectionclusters_client.go | 1114 +++++++++ ...ationprotectioncontainermappings_client.go | 164 +- ...oncontainermappings_client_example_test.go | 302 --- .../replicationprotectioncontainers_client.go | 255 +- ...rotectioncontainers_client_example_test.go | 286 --- .../replicationprotectionintents_client.go | 60 +- ...onprotectionintents_client_example_test.go | 151 -- .../replicationrecoveryplans_client.go | 306 +-- ...cationrecoveryplans_client_example_test.go | 1035 -------- ...icationrecoveryservicesproviders_client.go | 164 +- ...ryservicesproviders_client_example_test.go | 293 --- ...ionstorageclassificationmappings_client.go | 112 +- ...ssificationmappings_client_example_test.go | 176 -- ...eplicationstorageclassifications_client.go | 60 +- ...rageclassifications_client_example_test.go | 118 - .../replicationvaulthealth_client.go | 46 +- ...licationvaulthealth_client_example_test.go | 110 - .../replicationvaultsetting_client.go | 66 +- ...icationvaultsetting_client_example_test.go | 119 - .../replicationvcenters_client.go | 138 +- ...replicationvcenters_client_example_test.go | 251 -- .../responses.go | 89 + .../supportedoperatingsystems_client.go | 20 +- ...tedoperatingsystems_client_example_test.go | 67 - .../targetcomputesizes_client.go | 20 +- .../targetcomputesizes_client_example_test.go | 77 - 102 files changed, 8485 insertions(+), 10933 deletions(-) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/clusterrecoverypoint_client.go create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/clusterrecoverypoints_client.go create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/clusterrecoverypoint_server.go create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/clusterrecoverypoints_server.go create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationprotectionclusters_server.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/migrationrecoverypoints_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/recoverypoints_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationalertsettings_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationappliances_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationeligibilityresults_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationevents_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationfabrics_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationjobs_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationlogicalnetworks_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationmigrationitems_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationnetworkmappings_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationnetworks_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectableitems_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotecteditems_client_example_test.go create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectionclusters_client.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectioncontainermappings_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectioncontainers_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectionintents_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationrecoveryplans_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationrecoveryservicesproviders_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationstorageclassificationmappings_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationstorageclassifications_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvaulthealth_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvaultsetting_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvcenters_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/supportedoperatingsystems_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/targetcomputesizes_client_example_test.go diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/CHANGELOG.md b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/CHANGELOG.md index 3367ad7b7f5b..cd544554ce14 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/CHANGELOG.md +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/CHANGELOG.md @@ -1,5 +1,117 @@ # Release History +## 2.4.0 (2024-12-24) +### Features Added + +- New value `DiskAccountTypePremiumV2LRS`, `DiskAccountTypePremiumZRS`, `DiskAccountTypeStandardSSDZRS`, `DiskAccountTypeUltraSSDLRS` added to enum type `DiskAccountType` +- New enum type `ClusterRecoveryPointType` with values `ClusterRecoveryPointTypeApplicationConsistent`, `ClusterRecoveryPointTypeCrashConsistent`, `ClusterRecoveryPointTypeNotSpecified` +- New enum type `DiskState` with values `DiskStateInitialReplicationFailed`, `DiskStateInitialReplicationPending`, `DiskStateProtected`, `DiskStateUnavailable` +- New enum type `FailoverDirection` with values `FailoverDirectionPrimaryToRecovery`, `FailoverDirectionRecoveryToPrimary` +- New enum type `LinuxLicenseType` with values `LinuxLicenseTypeLinuxServer`, `LinuxLicenseTypeNoLicenseType`, `LinuxLicenseTypeNotSpecified` +- New enum type `SecurityConfiguration` with values `SecurityConfigurationDisabled`, `SecurityConfigurationEnabled` +- New function `*A2AApplyClusterRecoveryPointInput.GetApplyClusterRecoveryPointProviderSpecificInput() *ApplyClusterRecoveryPointProviderSpecificInput` +- New function `*A2AClusterRecoveryPointDetails.GetClusterProviderSpecificRecoveryPointDetails() *ClusterProviderSpecificRecoveryPointDetails` +- New function `*A2AClusterTestFailoverInput.GetClusterTestFailoverProviderSpecificInput() *ClusterTestFailoverProviderSpecificInput` +- New function `*A2AClusterUnplannedFailoverInput.GetClusterUnplannedFailoverProviderSpecificInput() *ClusterUnplannedFailoverProviderSpecificInput` +- New function `*A2AReplicationProtectionClusterDetails.GetReplicationClusterProviderSpecificSettings() *ReplicationClusterProviderSpecificSettings` +- New function `*A2ASharedDiskReplicationDetails.GetSharedDiskReplicationProviderSpecificSettings() *SharedDiskReplicationProviderSpecificSettings` +- New function `*A2ASwitchClusterProtectionInput.GetSwitchClusterProtectionProviderSpecificInput() *SwitchClusterProtectionProviderSpecificInput` +- New function `*ApplyClusterRecoveryPointProviderSpecificInput.GetApplyClusterRecoveryPointProviderSpecificInput() *ApplyClusterRecoveryPointProviderSpecificInput` +- New function `*ClientFactory.NewClusterRecoveryPointClient() *ClusterRecoveryPointClient` +- New function `*ClientFactory.NewClusterRecoveryPointsClient() *ClusterRecoveryPointsClient` +- New function `*ClientFactory.NewReplicationProtectionClustersClient() *ReplicationProtectionClustersClient` +- New function `*ClusterFailoverJobDetails.GetJobDetails() *JobDetails` +- New function `*ClusterProviderSpecificRecoveryPointDetails.GetClusterProviderSpecificRecoveryPointDetails() *ClusterProviderSpecificRecoveryPointDetails` +- New function `NewClusterRecoveryPointClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ClusterRecoveryPointClient, error)` +- New function `*ClusterRecoveryPointClient.Get(context.Context, string, string, string, string, string, string, *ClusterRecoveryPointClientGetOptions) (ClusterRecoveryPointClientGetResponse, error)` +- New function `NewClusterRecoveryPointsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ClusterRecoveryPointsClient, error)` +- New function `*ClusterRecoveryPointsClient.NewListByReplicationProtectionClusterPager(string, string, string, string, string, *ClusterRecoveryPointsClientListByReplicationProtectionClusterOptions) *runtime.Pager[ClusterRecoveryPointsClientListByReplicationProtectionClusterResponse]` +- New function `*ClusterSwitchProtectionJobDetails.GetJobDetails() *JobDetails` +- New function `*ClusterTestFailoverJobDetails.GetJobDetails() *JobDetails` +- New function `*ClusterTestFailoverProviderSpecificInput.GetClusterTestFailoverProviderSpecificInput() *ClusterTestFailoverProviderSpecificInput` +- New function `*ClusterUnplannedFailoverProviderSpecificInput.GetClusterUnplannedFailoverProviderSpecificInput() *ClusterUnplannedFailoverProviderSpecificInput` +- New function `*InMageRcmAddDisksInput.GetAddDisksProviderSpecificInput() *AddDisksProviderSpecificInput` +- New function `*ReplicationClusterProviderSpecificSettings.GetReplicationClusterProviderSpecificSettings() *ReplicationClusterProviderSpecificSettings` +- New function `NewReplicationProtectionClustersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ReplicationProtectionClustersClient, error)` +- New function `*ReplicationProtectionClustersClient.BeginApplyRecoveryPoint(context.Context, string, string, string, string, string, ApplyClusterRecoveryPointInput, *ReplicationProtectionClustersClientBeginApplyRecoveryPointOptions) (*runtime.Poller[ReplicationProtectionClustersClientApplyRecoveryPointResponse], error)` +- New function `*ReplicationProtectionClustersClient.BeginCreate(context.Context, string, string, string, string, string, ReplicationProtectionCluster, *ReplicationProtectionClustersClientBeginCreateOptions) (*runtime.Poller[ReplicationProtectionClustersClientCreateResponse], error)` +- New function `*ReplicationProtectionClustersClient.BeginFailoverCommit(context.Context, string, string, string, string, string, *ReplicationProtectionClustersClientBeginFailoverCommitOptions) (*runtime.Poller[ReplicationProtectionClustersClientFailoverCommitResponse], error)` +- New function `*ReplicationProtectionClustersClient.Get(context.Context, string, string, string, string, string, *ReplicationProtectionClustersClientGetOptions) (ReplicationProtectionClustersClientGetResponse, error)` +- New function `*ReplicationProtectionClustersClient.GetOperationResults(context.Context, string, string, string, string, string, string, *ReplicationProtectionClustersClientGetOperationResultsOptions) (ReplicationProtectionClustersClientGetOperationResultsResponse, error)` +- New function `*ReplicationProtectionClustersClient.NewListByReplicationProtectionContainersPager(string, string, string, string, *ReplicationProtectionClustersClientListByReplicationProtectionContainersOptions) *runtime.Pager[ReplicationProtectionClustersClientListByReplicationProtectionContainersResponse]` +- New function `*ReplicationProtectionClustersClient.NewListPager(string, string, *ReplicationProtectionClustersClientListOptions) *runtime.Pager[ReplicationProtectionClustersClientListResponse]` +- New function `*ReplicationProtectionClustersClient.BeginPurge(context.Context, string, string, string, string, string, *ReplicationProtectionClustersClientBeginPurgeOptions) (*runtime.Poller[ReplicationProtectionClustersClientPurgeResponse], error)` +- New function `*ReplicationProtectionClustersClient.BeginRepairReplication(context.Context, string, string, string, string, string, *ReplicationProtectionClustersClientBeginRepairReplicationOptions) (*runtime.Poller[ReplicationProtectionClustersClientRepairReplicationResponse], error)` +- New function `*ReplicationProtectionClustersClient.BeginTestFailover(context.Context, string, string, string, string, string, ClusterTestFailoverInput, *ReplicationProtectionClustersClientBeginTestFailoverOptions) (*runtime.Poller[ReplicationProtectionClustersClientTestFailoverResponse], error)` +- New function `*ReplicationProtectionClustersClient.BeginTestFailoverCleanup(context.Context, string, string, string, string, string, ClusterTestFailoverCleanupInput, *ReplicationProtectionClustersClientBeginTestFailoverCleanupOptions) (*runtime.Poller[ReplicationProtectionClustersClientTestFailoverCleanupResponse], error)` +- New function `*ReplicationProtectionClustersClient.BeginUnplannedFailover(context.Context, string, string, string, string, string, ClusterUnplannedFailoverInput, *ReplicationProtectionClustersClientBeginUnplannedFailoverOptions) (*runtime.Poller[ReplicationProtectionClustersClientUnplannedFailoverResponse], error)` +- New function `*ReplicationProtectionContainersClient.BeginSwitchClusterProtection(context.Context, string, string, string, string, SwitchClusterProtectionInput, *ReplicationProtectionContainersClientBeginSwitchClusterProtectionOptions) (*runtime.Poller[ReplicationProtectionContainersClientSwitchClusterProtectionResponse], error)` +- New function `*SharedDiskReplicationProviderSpecificSettings.GetSharedDiskReplicationProviderSpecificSettings() *SharedDiskReplicationProviderSpecificSettings` +- New function `*SwitchClusterProtectionProviderSpecificInput.GetSwitchClusterProtectionProviderSpecificInput() *SwitchClusterProtectionProviderSpecificInput` +- New struct `A2AApplyClusterRecoveryPointInput` +- New struct `A2AClusterRecoveryPointDetails` +- New struct `A2AClusterTestFailoverInput` +- New struct `A2AClusterUnplannedFailoverInput` +- New struct `A2AProtectedItemDetail` +- New struct `A2AReplicationProtectionClusterDetails` +- New struct `A2ASharedDiskIRErrorDetails` +- New struct `A2ASharedDiskReplicationDetails` +- New struct `A2ASwitchClusterProtectionInput` +- New struct `ApplyClusterRecoveryPointInput` +- New struct `ApplyClusterRecoveryPointInputProperties` +- New struct `ClusterFailoverJobDetails` +- New struct `ClusterRecoveryPoint` +- New struct `ClusterRecoveryPointCollection` +- New struct `ClusterRecoveryPointProperties` +- New struct `ClusterSwitchProtectionJobDetails` +- New struct `ClusterTestFailoverCleanupInput` +- New struct `ClusterTestFailoverCleanupInputProperties` +- New struct `ClusterTestFailoverInput` +- New struct `ClusterTestFailoverInputProperties` +- New struct `ClusterTestFailoverJobDetails` +- New struct `ClusterUnplannedFailoverInput` +- New struct `ClusterUnplannedFailoverInputProperties` +- New struct `InMageRcmAddDisksInput` +- New struct `InMageRcmUnProtectedDiskDetails` +- New struct `ManagedRunCommandScriptInput` +- New struct `RegisteredClusterNodes` +- New struct `ReplicationProtectionCluster` +- New struct `ReplicationProtectionClusterCollection` +- New struct `ReplicationProtectionClusterProperties` +- New struct `SecurityProfileProperties` +- New struct `SharedDiskReplicationItemProperties` +- New struct `SwitchClusterProtectionInput` +- New struct `SwitchClusterProtectionInputProperties` +- New struct `UserCreatedResourceTag` +- New field `ProtectionClusterID` in struct `A2AEnableProtectionInput` +- New field `IsClusterInfraReady`, `ProtectionClusterID` in struct `A2AReplicationDetails` +- New field `DiskSizeInGB`, `Iops`, `SectorSizeInBytes`, `ThroughputInMbps` in struct `HyperVReplicaAzureDiskInputDetails` +- New field `LinuxLicenseType`, `TargetVMSecurityProfile`, `UserSelectedOSName` in struct `HyperVReplicaAzureEnableProtectionInput` +- New field `DiskSizeInGB`, `Iops`, `SectorSizeInBytes`, `TargetDiskAccountType`, `ThroughputInMbps` in struct `HyperVReplicaAzureManagedDiskDetails` +- New field `LinuxLicenseType`, `TargetVMSecurityProfile` in struct `HyperVReplicaAzureReplicationDetails` +- New field `LinuxLicenseType`, `UserSelectedOSName` in struct `HyperVReplicaAzureUpdateReplicationProtectedItemInput` +- New field `DiskSizeInGB`, `Iops`, `SectorSizeInBytes`, `ThroughputInMbps` in struct `InMageRcmDiskInput` +- New field `DiskSizeInGB`, `Iops`, `SectorSizeInBytes`, `ThroughputInMbps` in struct `InMageRcmDisksDefaultInput` +- New field `LinuxLicenseType`, `SQLServerLicenseType`, `SeedManagedDiskTags`, `TargetManagedDiskTags`, `TargetNicTags`, `TargetVMSecurityProfile`, `TargetVMTags`, `UserSelectedOSName` in struct `InMageRcmEnableProtectionInput` +- New field `TargetNicName` in struct `InMageRcmNicDetails` +- New field `TargetNicName` in struct `InMageRcmNicInput` +- New field `CustomTargetDiskName`, `DiskSizeInGB`, `DiskState`, `Iops`, `SectorSizeInBytes`, `ThroughputInMbps` in struct `InMageRcmProtectedDiskDetails` +- New field `LinuxLicenseType`, `OSName`, `SQLServerLicenseType`, `SeedManagedDiskTags`, `SupportedOSVersions`, `TargetManagedDiskTags`, `TargetNicTags`, `TargetVMSecurityProfile`, `TargetVMTags`, `UnprotectedDisks` in struct `InMageRcmReplicationDetails` +- New field `OSUpgradeVersion` in struct `InMageRcmTestFailoverInput` +- New field `OSUpgradeVersion` in struct `InMageRcmUnplannedFailoverInput` +- New field `LinuxLicenseType`, `SQLServerLicenseType`, `TargetManagedDiskTags`, `TargetNicTags`, `TargetVMTags`, `UserSelectedOSName` in struct `InMageRcmUpdateReplicationProtectedItemInput` +- New field `UserSelectedOSName` in struct `OSDetails` +- New field `DiskSizeInGB`, `Iops`, `ThroughputInMbps` in struct `UpdateDiskInput` +- New field `DiskSizeInGB`, `Iops`, `SectorSizeInBytes`, `ThroughputInMbps` in struct `VMwareCbtDiskInput` +- New field `LinuxLicenseType`, `UserSelectedOSName` in struct `VMwareCbtEnableMigrationInput` +- New field `PostMigrationSteps` in struct `VMwareCbtMigrateInput` +- New field `LinuxLicenseType` in struct `VMwareCbtMigrationDetails` +- New field `DiskSizeInGB`, `Iops`, `SectorSizeInBytes`, `ThroughputInMbps` in struct `VMwareCbtProtectedDiskDetails` +- New field `PostMigrationSteps` in struct `VMwareCbtTestMigrateInput` +- New field `DiskSizeInGB`, `Iops`, `ThroughputInMbps` in struct `VMwareCbtUpdateDiskInput` +- New field `LinuxLicenseType`, `UserSelectedOSName` in struct `VMwareCbtUpdateMigrationItemInput` + + ## 2.3.0 (2024-02-23) ### Features Added diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/README.md b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/README.md index 0487cf386c13..018247829321 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/README.md +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/README.md @@ -55,7 +55,7 @@ clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory( 0 + }, + Fetcher: func(ctx context.Context, page *ClusterRecoveryPointsClientListByReplicationProtectionClusterResponse) (ClusterRecoveryPointsClientListByReplicationProtectionClusterResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ClusterRecoveryPointsClient.NewListByReplicationProtectionClusterPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByReplicationProtectionClusterCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, options) + }, nil) + if err != nil { + return ClusterRecoveryPointsClientListByReplicationProtectionClusterResponse{}, err + } + return client.listByReplicationProtectionClusterHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByReplicationProtectionClusterCreateRequest creates the ListByReplicationProtectionCluster request. +func (client *ClusterRecoveryPointsClient) listByReplicationProtectionClusterCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, options *ClusterRecoveryPointsClientListByReplicationProtectionClusterOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/recoveryPoints" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if fabricName == "" { + return nil, errors.New("parameter fabricName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{fabricName}", url.PathEscape(fabricName)) + if protectionContainerName == "" { + return nil, errors.New("parameter protectionContainerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{protectionContainerName}", url.PathEscape(protectionContainerName)) + if replicationProtectionClusterName == "" { + return nil, errors.New("parameter replicationProtectionClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{replicationProtectionClusterName}", url.PathEscape(replicationProtectionClusterName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByReplicationProtectionClusterHandleResponse handles the ListByReplicationProtectionCluster response. +func (client *ClusterRecoveryPointsClient) listByReplicationProtectionClusterHandleResponse(resp *http.Response) (ClusterRecoveryPointsClientListByReplicationProtectionClusterResponse, error) { + result := ClusterRecoveryPointsClientListByReplicationProtectionClusterResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ClusterRecoveryPointCollection); err != nil { + return ClusterRecoveryPointsClientListByReplicationProtectionClusterResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/constants.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/constants.go index af837b128df5..58a46e7eebd8 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/constants.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/constants.go @@ -10,7 +10,7 @@ package armrecoveryservicessiterecovery const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery" - moduleVersion = "v2.3.0" + moduleVersion = "v2.4.0" ) // A2ARecoveryAvailabilityType - The recovery availability type of the virtual machine. @@ -192,6 +192,24 @@ func PossibleChurnOptionSelectedValues() []ChurnOptionSelected { } } +// ClusterRecoveryPointType - The recovery point type. +type ClusterRecoveryPointType string + +const ( + ClusterRecoveryPointTypeApplicationConsistent ClusterRecoveryPointType = "ApplicationConsistent" + ClusterRecoveryPointTypeCrashConsistent ClusterRecoveryPointType = "CrashConsistent" + ClusterRecoveryPointTypeNotSpecified ClusterRecoveryPointType = "NotSpecified" +) + +// PossibleClusterRecoveryPointTypeValues returns the possible values for the ClusterRecoveryPointType const type. +func PossibleClusterRecoveryPointTypeValues() []ClusterRecoveryPointType { + return []ClusterRecoveryPointType{ + ClusterRecoveryPointTypeApplicationConsistent, + ClusterRecoveryPointTypeCrashConsistent, + ClusterRecoveryPointTypeNotSpecified, + } +} + // DataSyncStatus - The data sync option. type DataSyncStatus string @@ -224,21 +242,29 @@ func PossibleDisableProtectionReasonValues() []DisableProtectionReason { } } -// DiskAccountType - The DiskType. +// DiskAccountType - The disk type. type DiskAccountType string const ( DiskAccountTypePremiumLRS DiskAccountType = "Premium_LRS" + DiskAccountTypePremiumV2LRS DiskAccountType = "PremiumV2_LRS" + DiskAccountTypePremiumZRS DiskAccountType = "Premium_ZRS" DiskAccountTypeStandardLRS DiskAccountType = "Standard_LRS" DiskAccountTypeStandardSSDLRS DiskAccountType = "StandardSSD_LRS" + DiskAccountTypeStandardSSDZRS DiskAccountType = "StandardSSD_ZRS" + DiskAccountTypeUltraSSDLRS DiskAccountType = "UltraSSD_LRS" ) // PossibleDiskAccountTypeValues returns the possible values for the DiskAccountType const type. func PossibleDiskAccountTypeValues() []DiskAccountType { return []DiskAccountType{ DiskAccountTypePremiumLRS, + DiskAccountTypePremiumV2LRS, + DiskAccountTypePremiumZRS, DiskAccountTypeStandardLRS, DiskAccountTypeStandardSSDLRS, + DiskAccountTypeStandardSSDZRS, + DiskAccountTypeUltraSSDLRS, } } @@ -264,6 +290,26 @@ func PossibleDiskReplicationProgressHealthValues() []DiskReplicationProgressHeal } } +// DiskState - The disk state. +type DiskState string + +const ( + DiskStateInitialReplicationFailed DiskState = "InitialReplicationFailed" + DiskStateInitialReplicationPending DiskState = "InitialReplicationPending" + DiskStateProtected DiskState = "Protected" + DiskStateUnavailable DiskState = "Unavailable" +) + +// PossibleDiskStateValues returns the possible values for the DiskState const type. +func PossibleDiskStateValues() []DiskState { + return []DiskState{ + DiskStateInitialReplicationFailed, + DiskStateInitialReplicationPending, + DiskStateProtected, + DiskStateUnavailable, + } +} + // EthernetAddressType - The source IP address type. type EthernetAddressType string @@ -330,6 +376,22 @@ func PossibleFailoverDeploymentModelValues() []FailoverDeploymentModel { } } +// FailoverDirection - Failover direction. +type FailoverDirection string + +const ( + FailoverDirectionPrimaryToRecovery FailoverDirection = "PrimaryToRecovery" + FailoverDirectionRecoveryToPrimary FailoverDirection = "RecoveryToPrimary" +) + +// PossibleFailoverDirectionValues returns the possible values for the FailoverDirection const type. +func PossibleFailoverDirectionValues() []FailoverDirection { + return []FailoverDirection{ + FailoverDirectionPrimaryToRecovery, + FailoverDirectionRecoveryToPrimary, + } +} + // HealthErrorCategory - The category of the health error. type HealthErrorCategory string @@ -452,6 +514,24 @@ func PossibleLicenseTypeValues() []LicenseType { } } +// LinuxLicenseType - The license type for Linux VM's. +type LinuxLicenseType string + +const ( + LinuxLicenseTypeLinuxServer LinuxLicenseType = "LinuxServer" + LinuxLicenseTypeNoLicenseType LinuxLicenseType = "NoLicenseType" + LinuxLicenseTypeNotSpecified LinuxLicenseType = "NotSpecified" +) + +// PossibleLinuxLicenseTypeValues returns the possible values for the LinuxLicenseType const type. +func PossibleLinuxLicenseTypeValues() []LinuxLicenseType { + return []LinuxLicenseType{ + LinuxLicenseTypeLinuxServer, + LinuxLicenseTypeNoLicenseType, + LinuxLicenseTypeNotSpecified, + } +} + type MigrationItemOperation string const ( @@ -872,6 +952,22 @@ func PossibleSQLServerLicenseTypeValues() []SQLServerLicenseType { } } +// SecurityConfiguration - Security configuration state. +type SecurityConfiguration string + +const ( + SecurityConfigurationDisabled SecurityConfiguration = "Disabled" + SecurityConfigurationEnabled SecurityConfiguration = "Enabled" +) + +// PossibleSecurityConfigurationValues returns the possible values for the SecurityConfiguration const type. +func PossibleSecurityConfigurationValues() []SecurityConfiguration { + return []SecurityConfiguration{ + SecurityConfigurationDisabled, + SecurityConfigurationEnabled, + } +} + // SecurityType - The target VM security type. type SecurityType string diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/clusterrecoverypoint_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/clusterrecoverypoint_server.go new file mode 100644 index 000000000000..411444caecfc --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/clusterrecoverypoint_server.go @@ -0,0 +1,116 @@ +//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 fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/v2" + "net/http" + "net/url" + "regexp" +) + +// ClusterRecoveryPointServer is a fake server for instances of the armrecoveryservicessiterecovery.ClusterRecoveryPointClient type. +type ClusterRecoveryPointServer struct { + // Get is the fake for method ClusterRecoveryPointClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, recoveryPointName string, options *armrecoveryservicessiterecovery.ClusterRecoveryPointClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ClusterRecoveryPointClientGetResponse], errResp azfake.ErrorResponder) +} + +// NewClusterRecoveryPointServerTransport creates a new instance of ClusterRecoveryPointServerTransport with the provided implementation. +// The returned ClusterRecoveryPointServerTransport instance is connected to an instance of armrecoveryservicessiterecovery.ClusterRecoveryPointClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewClusterRecoveryPointServerTransport(srv *ClusterRecoveryPointServer) *ClusterRecoveryPointServerTransport { + return &ClusterRecoveryPointServerTransport{srv: srv} +} + +// ClusterRecoveryPointServerTransport connects instances of armrecoveryservicessiterecovery.ClusterRecoveryPointClient to instances of ClusterRecoveryPointServer. +// Don't use this type directly, use NewClusterRecoveryPointServerTransport instead. +type ClusterRecoveryPointServerTransport struct { + srv *ClusterRecoveryPointServer +} + +// Do implements the policy.Transporter interface for ClusterRecoveryPointServerTransport. +func (c *ClusterRecoveryPointServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "ClusterRecoveryPointClient.Get": + resp, err = c.dispatchGet(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (c *ClusterRecoveryPointServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if c.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.RecoveryServices/vaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationFabrics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionContainers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/recoveryPoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 7 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + fabricNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fabricName")]) + if err != nil { + return nil, err + } + protectionContainerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("protectionContainerName")]) + if err != nil { + return nil, err + } + replicationProtectionClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("replicationProtectionClusterName")]) + if err != nil { + return nil, err + } + recoveryPointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("recoveryPointName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicationProtectionClusterNameParam, recoveryPointNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ClusterRecoveryPoint, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/clusterrecoverypoints_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/clusterrecoverypoints_server.go new file mode 100644 index 000000000000..45e5e2afe6ab --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/clusterrecoverypoints_server.go @@ -0,0 +1,124 @@ +//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 fake + +import ( + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/v2" + "net/http" + "net/url" + "regexp" +) + +// ClusterRecoveryPointsServer is a fake server for instances of the armrecoveryservicessiterecovery.ClusterRecoveryPointsClient type. +type ClusterRecoveryPointsServer struct { + // NewListByReplicationProtectionClusterPager is the fake for method ClusterRecoveryPointsClient.NewListByReplicationProtectionClusterPager + // HTTP status codes to indicate success: http.StatusOK + NewListByReplicationProtectionClusterPager func(resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, options *armrecoveryservicessiterecovery.ClusterRecoveryPointsClientListByReplicationProtectionClusterOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ClusterRecoveryPointsClientListByReplicationProtectionClusterResponse]) +} + +// NewClusterRecoveryPointsServerTransport creates a new instance of ClusterRecoveryPointsServerTransport with the provided implementation. +// The returned ClusterRecoveryPointsServerTransport instance is connected to an instance of armrecoveryservicessiterecovery.ClusterRecoveryPointsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewClusterRecoveryPointsServerTransport(srv *ClusterRecoveryPointsServer) *ClusterRecoveryPointsServerTransport { + return &ClusterRecoveryPointsServerTransport{ + srv: srv, + newListByReplicationProtectionClusterPager: newTracker[azfake.PagerResponder[armrecoveryservicessiterecovery.ClusterRecoveryPointsClientListByReplicationProtectionClusterResponse]](), + } +} + +// ClusterRecoveryPointsServerTransport connects instances of armrecoveryservicessiterecovery.ClusterRecoveryPointsClient to instances of ClusterRecoveryPointsServer. +// Don't use this type directly, use NewClusterRecoveryPointsServerTransport instead. +type ClusterRecoveryPointsServerTransport struct { + srv *ClusterRecoveryPointsServer + newListByReplicationProtectionClusterPager *tracker[azfake.PagerResponder[armrecoveryservicessiterecovery.ClusterRecoveryPointsClientListByReplicationProtectionClusterResponse]] +} + +// Do implements the policy.Transporter interface for ClusterRecoveryPointsServerTransport. +func (c *ClusterRecoveryPointsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "ClusterRecoveryPointsClient.NewListByReplicationProtectionClusterPager": + resp, err = c.dispatchNewListByReplicationProtectionClusterPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (c *ClusterRecoveryPointsServerTransport) dispatchNewListByReplicationProtectionClusterPager(req *http.Request) (*http.Response, error) { + if c.srv.NewListByReplicationProtectionClusterPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByReplicationProtectionClusterPager not implemented")} + } + newListByReplicationProtectionClusterPager := c.newListByReplicationProtectionClusterPager.get(req) + if newListByReplicationProtectionClusterPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.RecoveryServices/vaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationFabrics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionContainers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/recoveryPoints` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 6 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + fabricNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fabricName")]) + if err != nil { + return nil, err + } + protectionContainerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("protectionContainerName")]) + if err != nil { + return nil, err + } + replicationProtectionClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("replicationProtectionClusterName")]) + if err != nil { + return nil, err + } + resp := c.srv.NewListByReplicationProtectionClusterPager(resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicationProtectionClusterNameParam, nil) + newListByReplicationProtectionClusterPager = &resp + c.newListByReplicationProtectionClusterPager.add(req, newListByReplicationProtectionClusterPager) + server.PagerResponderInjectNextLinks(newListByReplicationProtectionClusterPager, req, func(page *armrecoveryservicessiterecovery.ClusterRecoveryPointsClientListByReplicationProtectionClusterResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByReplicationProtectionClusterPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListByReplicationProtectionClusterPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByReplicationProtectionClusterPager) { + c.newListByReplicationProtectionClusterPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/migrationrecoverypoints_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/migrationrecoverypoints_server.go index 885949d36af6..a8ac1a97dc3a 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/migrationrecoverypoints_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/migrationrecoverypoints_server.go @@ -26,11 +26,11 @@ import ( type MigrationRecoveryPointsServer struct { // Get is the fake for method MigrationRecoveryPointsClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string, options *armrecoveryservicessiterecovery.MigrationRecoveryPointsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.MigrationRecoveryPointsClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string, options *armrecoveryservicessiterecovery.MigrationRecoveryPointsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.MigrationRecoveryPointsClientGetResponse], errResp azfake.ErrorResponder) // NewListByReplicationMigrationItemsPager is the fake for method MigrationRecoveryPointsClient.NewListByReplicationMigrationItemsPager // HTTP status codes to indicate success: http.StatusOK - NewListByReplicationMigrationItemsPager func(resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, options *armrecoveryservicessiterecovery.MigrationRecoveryPointsClientListByReplicationMigrationItemsOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.MigrationRecoveryPointsClientListByReplicationMigrationItemsResponse]) + NewListByReplicationMigrationItemsPager func(resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, options *armrecoveryservicessiterecovery.MigrationRecoveryPointsClientListByReplicationMigrationItemsOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.MigrationRecoveryPointsClientListByReplicationMigrationItemsResponse]) } // NewMigrationRecoveryPointsServerTransport creates a new instance of MigrationRecoveryPointsServerTransport with the provided implementation. @@ -87,11 +87,11 @@ func (m *MigrationRecoveryPointsServerTransport) dispatchGet(req *http.Request) if matches == nil || len(matches) < 7 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -111,7 +111,7 @@ func (m *MigrationRecoveryPointsServerTransport) dispatchGet(req *http.Request) if err != nil { return nil, err } - respr, errRespr := m.srv.Get(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, migrationItemNameParam, migrationRecoveryPointNameParam, nil) + respr, errRespr := m.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, migrationItemNameParam, migrationRecoveryPointNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -138,11 +138,11 @@ func (m *MigrationRecoveryPointsServerTransport) dispatchNewListByReplicationMig if matches == nil || len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -158,7 +158,7 @@ func (m *MigrationRecoveryPointsServerTransport) dispatchNewListByReplicationMig if err != nil { return nil, err } - resp := m.srv.NewListByReplicationMigrationItemsPager(resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, migrationItemNameParam, nil) + resp := m.srv.NewListByReplicationMigrationItemsPager(resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, migrationItemNameParam, nil) newListByReplicationMigrationItemsPager = &resp m.newListByReplicationMigrationItemsPager.add(req, newListByReplicationMigrationItemsPager) server.PagerResponderInjectNextLinks(newListByReplicationMigrationItemsPager, req, func(page *armrecoveryservicessiterecovery.MigrationRecoveryPointsClientListByReplicationMigrationItemsResponse, createLink func() string) { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/recoverypoints_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/recoverypoints_server.go index 8911eb5472b6..e34475eb0e95 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/recoverypoints_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/recoverypoints_server.go @@ -26,11 +26,11 @@ import ( type RecoveryPointsServer struct { // Get is the fake for method RecoveryPointsClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string, options *armrecoveryservicessiterecovery.RecoveryPointsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.RecoveryPointsClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string, options *armrecoveryservicessiterecovery.RecoveryPointsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.RecoveryPointsClientGetResponse], errResp azfake.ErrorResponder) // NewListByReplicationProtectedItemsPager is the fake for method RecoveryPointsClient.NewListByReplicationProtectedItemsPager // HTTP status codes to indicate success: http.StatusOK - NewListByReplicationProtectedItemsPager func(resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *armrecoveryservicessiterecovery.RecoveryPointsClientListByReplicationProtectedItemsOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.RecoveryPointsClientListByReplicationProtectedItemsResponse]) + NewListByReplicationProtectedItemsPager func(resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *armrecoveryservicessiterecovery.RecoveryPointsClientListByReplicationProtectedItemsOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.RecoveryPointsClientListByReplicationProtectedItemsResponse]) } // NewRecoveryPointsServerTransport creates a new instance of RecoveryPointsServerTransport with the provided implementation. @@ -87,11 +87,11 @@ func (r *RecoveryPointsServerTransport) dispatchGet(req *http.Request) (*http.Re if matches == nil || len(matches) < 7 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -111,7 +111,7 @@ func (r *RecoveryPointsServerTransport) dispatchGet(req *http.Request) (*http.Re if err != nil { return nil, err } - respr, errRespr := r.srv.Get(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, recoveryPointNameParam, nil) + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, recoveryPointNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -138,11 +138,11 @@ func (r *RecoveryPointsServerTransport) dispatchNewListByReplicationProtectedIte if matches == nil || len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -158,7 +158,7 @@ func (r *RecoveryPointsServerTransport) dispatchNewListByReplicationProtectedIte if err != nil { return nil, err } - resp := r.srv.NewListByReplicationProtectedItemsPager(resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, nil) + resp := r.srv.NewListByReplicationProtectedItemsPager(resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, nil) newListByReplicationProtectedItemsPager = &resp r.newListByReplicationProtectedItemsPager.add(req, newListByReplicationProtectedItemsPager) server.PagerResponderInjectNextLinks(newListByReplicationProtectedItemsPager, req, func(page *armrecoveryservicessiterecovery.RecoveryPointsClientListByReplicationProtectedItemsResponse, createLink func() string) { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationalertsettings_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationalertsettings_server.go index fba314f200c7..05306b72cef3 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationalertsettings_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationalertsettings_server.go @@ -26,15 +26,15 @@ import ( type ReplicationAlertSettingsServer struct { // Create is the fake for method ReplicationAlertSettingsClient.Create // HTTP status codes to indicate success: http.StatusOK - Create func(ctx context.Context, resourceName string, resourceGroupName string, alertSettingName string, request armrecoveryservicessiterecovery.ConfigureAlertRequest, options *armrecoveryservicessiterecovery.ReplicationAlertSettingsClientCreateOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationAlertSettingsClientCreateResponse], errResp azfake.ErrorResponder) + Create func(ctx context.Context, resourceGroupName string, resourceName string, alertSettingName string, request armrecoveryservicessiterecovery.ConfigureAlertRequest, options *armrecoveryservicessiterecovery.ReplicationAlertSettingsClientCreateOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationAlertSettingsClientCreateResponse], errResp azfake.ErrorResponder) // Get is the fake for method ReplicationAlertSettingsClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceName string, resourceGroupName string, alertSettingName string, options *armrecoveryservicessiterecovery.ReplicationAlertSettingsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationAlertSettingsClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, resourceName string, alertSettingName string, options *armrecoveryservicessiterecovery.ReplicationAlertSettingsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationAlertSettingsClientGetResponse], errResp azfake.ErrorResponder) // NewListPager is the fake for method ReplicationAlertSettingsClient.NewListPager // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceName string, resourceGroupName string, options *armrecoveryservicessiterecovery.ReplicationAlertSettingsClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationAlertSettingsClientListResponse]) + NewListPager func(resourceGroupName string, resourceName string, options *armrecoveryservicessiterecovery.ReplicationAlertSettingsClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationAlertSettingsClientListResponse]) } // NewReplicationAlertSettingsServerTransport creates a new instance of ReplicationAlertSettingsServerTransport with the provided implementation. @@ -97,11 +97,11 @@ func (r *ReplicationAlertSettingsServerTransport) dispatchCreate(req *http.Reque if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -109,7 +109,7 @@ func (r *ReplicationAlertSettingsServerTransport) dispatchCreate(req *http.Reque if err != nil { return nil, err } - respr, errRespr := r.srv.Create(req.Context(), resourceNameParam, resourceGroupNameParam, alertSettingNameParam, body, nil) + respr, errRespr := r.srv.Create(req.Context(), resourceGroupNameParam, resourceNameParam, alertSettingNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -134,11 +134,11 @@ func (r *ReplicationAlertSettingsServerTransport) dispatchGet(req *http.Request) if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -146,7 +146,7 @@ func (r *ReplicationAlertSettingsServerTransport) dispatchGet(req *http.Request) if err != nil { return nil, err } - respr, errRespr := r.srv.Get(req.Context(), resourceNameParam, resourceGroupNameParam, alertSettingNameParam, nil) + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, alertSettingNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -173,15 +173,15 @@ func (r *ReplicationAlertSettingsServerTransport) dispatchNewListPager(req *http if matches == nil || len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } - resp := r.srv.NewListPager(resourceNameParam, resourceGroupNameParam, nil) + resp := r.srv.NewListPager(resourceGroupNameParam, resourceNameParam, nil) newListPager = &resp r.newListPager.add(req, newListPager) server.PagerResponderInjectNextLinks(newListPager, req, func(page *armrecoveryservicessiterecovery.ReplicationAlertSettingsClientListResponse, createLink func() string) { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationappliances_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationappliances_server.go index 62c3dc48d9ca..677e9b63ea5a 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationappliances_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationappliances_server.go @@ -25,7 +25,7 @@ import ( type ReplicationAppliancesServer struct { // NewListPager is the fake for method ReplicationAppliancesClient.NewListPager // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceName string, resourceGroupName string, options *armrecoveryservicessiterecovery.ReplicationAppliancesClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationAppliancesClientListResponse]) + NewListPager func(resourceGroupName string, resourceName string, options *armrecoveryservicessiterecovery.ReplicationAppliancesClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationAppliancesClientListResponse]) } // NewReplicationAppliancesServerTransport creates a new instance of ReplicationAppliancesServerTransport with the provided implementation. @@ -83,11 +83,11 @@ func (r *ReplicationAppliancesServerTransport) dispatchNewListPager(req *http.Re return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } qp := req.URL.Query() - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -102,7 +102,7 @@ func (r *ReplicationAppliancesServerTransport) dispatchNewListPager(req *http.Re Filter: filterParam, } } - resp := r.srv.NewListPager(resourceNameParam, resourceGroupNameParam, options) + resp := r.srv.NewListPager(resourceGroupNameParam, resourceNameParam, options) newListPager = &resp r.newListPager.add(req, newListPager) server.PagerResponderInjectNextLinks(newListPager, req, func(page *armrecoveryservicessiterecovery.ReplicationAppliancesClientListResponse, createLink func() string) { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationevents_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationevents_server.go index 9f937d2ba4a0..e099a41c26f1 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationevents_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationevents_server.go @@ -26,11 +26,11 @@ import ( type ReplicationEventsServer struct { // Get is the fake for method ReplicationEventsClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceName string, resourceGroupName string, eventName string, options *armrecoveryservicessiterecovery.ReplicationEventsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationEventsClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, resourceName string, eventName string, options *armrecoveryservicessiterecovery.ReplicationEventsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationEventsClientGetResponse], errResp azfake.ErrorResponder) // NewListPager is the fake for method ReplicationEventsClient.NewListPager // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceName string, resourceGroupName string, options *armrecoveryservicessiterecovery.ReplicationEventsClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationEventsClientListResponse]) + NewListPager func(resourceGroupName string, resourceName string, options *armrecoveryservicessiterecovery.ReplicationEventsClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationEventsClientListResponse]) } // NewReplicationEventsServerTransport creates a new instance of ReplicationEventsServerTransport with the provided implementation. @@ -87,11 +87,11 @@ func (r *ReplicationEventsServerTransport) dispatchGet(req *http.Request) (*http if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -99,7 +99,7 @@ func (r *ReplicationEventsServerTransport) dispatchGet(req *http.Request) (*http if err != nil { return nil, err } - respr, errRespr := r.srv.Get(req.Context(), resourceNameParam, resourceGroupNameParam, eventNameParam, nil) + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, eventNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -127,11 +127,11 @@ func (r *ReplicationEventsServerTransport) dispatchNewListPager(req *http.Reques return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } qp := req.URL.Query() - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -146,7 +146,7 @@ func (r *ReplicationEventsServerTransport) dispatchNewListPager(req *http.Reques Filter: filterParam, } } - resp := r.srv.NewListPager(resourceNameParam, resourceGroupNameParam, options) + resp := r.srv.NewListPager(resourceGroupNameParam, resourceNameParam, options) newListPager = &resp r.newListPager.add(req, newListPager) server.PagerResponderInjectNextLinks(newListPager, req, func(page *armrecoveryservicessiterecovery.ReplicationEventsClientListResponse, createLink func() string) { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationfabrics_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationfabrics_server.go index e513b591350c..f514a6f095e9 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationfabrics_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationfabrics_server.go @@ -26,35 +26,35 @@ import ( type ReplicationFabricsServer struct { // BeginCheckConsistency is the fake for method ReplicationFabricsClient.BeginCheckConsistency // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginCheckConsistency func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *armrecoveryservicessiterecovery.ReplicationFabricsClientBeginCheckConsistencyOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationFabricsClientCheckConsistencyResponse], errResp azfake.ErrorResponder) + BeginCheckConsistency func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *armrecoveryservicessiterecovery.ReplicationFabricsClientBeginCheckConsistencyOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationFabricsClientCheckConsistencyResponse], errResp azfake.ErrorResponder) // BeginCreate is the fake for method ReplicationFabricsClient.BeginCreate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginCreate func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, input armrecoveryservicessiterecovery.FabricCreationInput, options *armrecoveryservicessiterecovery.ReplicationFabricsClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationFabricsClientCreateResponse], errResp azfake.ErrorResponder) + BeginCreate func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, input armrecoveryservicessiterecovery.FabricCreationInput, options *armrecoveryservicessiterecovery.ReplicationFabricsClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationFabricsClientCreateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method ReplicationFabricsClient.BeginDelete // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *armrecoveryservicessiterecovery.ReplicationFabricsClientBeginDeleteOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationFabricsClientDeleteResponse], errResp azfake.ErrorResponder) + BeginDelete func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *armrecoveryservicessiterecovery.ReplicationFabricsClientBeginDeleteOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationFabricsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method ReplicationFabricsClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *armrecoveryservicessiterecovery.ReplicationFabricsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationFabricsClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *armrecoveryservicessiterecovery.ReplicationFabricsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationFabricsClientGetResponse], errResp azfake.ErrorResponder) // NewListPager is the fake for method ReplicationFabricsClient.NewListPager // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceName string, resourceGroupName string, options *armrecoveryservicessiterecovery.ReplicationFabricsClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationFabricsClientListResponse]) + NewListPager func(resourceGroupName string, resourceName string, options *armrecoveryservicessiterecovery.ReplicationFabricsClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationFabricsClientListResponse]) // BeginMigrateToAAD is the fake for method ReplicationFabricsClient.BeginMigrateToAAD // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginMigrateToAAD func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *armrecoveryservicessiterecovery.ReplicationFabricsClientBeginMigrateToAADOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationFabricsClientMigrateToAADResponse], errResp azfake.ErrorResponder) + BeginMigrateToAAD func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *armrecoveryservicessiterecovery.ReplicationFabricsClientBeginMigrateToAADOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationFabricsClientMigrateToAADResponse], errResp azfake.ErrorResponder) // BeginPurge is the fake for method ReplicationFabricsClient.BeginPurge // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginPurge func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *armrecoveryservicessiterecovery.ReplicationFabricsClientBeginPurgeOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationFabricsClientPurgeResponse], errResp azfake.ErrorResponder) + BeginPurge func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *armrecoveryservicessiterecovery.ReplicationFabricsClientBeginPurgeOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationFabricsClientPurgeResponse], errResp azfake.ErrorResponder) // BeginReassociateGateway is the fake for method ReplicationFabricsClient.BeginReassociateGateway // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginReassociateGateway func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, failoverProcessServerRequest armrecoveryservicessiterecovery.FailoverProcessServerRequest, options *armrecoveryservicessiterecovery.ReplicationFabricsClientBeginReassociateGatewayOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationFabricsClientReassociateGatewayResponse], errResp azfake.ErrorResponder) + BeginReassociateGateway func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, failoverProcessServerRequest armrecoveryservicessiterecovery.FailoverProcessServerRequest, options *armrecoveryservicessiterecovery.ReplicationFabricsClientBeginReassociateGatewayOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationFabricsClientReassociateGatewayResponse], errResp azfake.ErrorResponder) // BeginRemoveInfra is the fake for method ReplicationFabricsClient.BeginRemoveInfra // HTTP status codes to indicate success: http.StatusAccepted @@ -62,7 +62,7 @@ type ReplicationFabricsServer struct { // BeginRenewCertificate is the fake for method ReplicationFabricsClient.BeginRenewCertificate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginRenewCertificate func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, renewCertificate armrecoveryservicessiterecovery.RenewCertificateInput, options *armrecoveryservicessiterecovery.ReplicationFabricsClientBeginRenewCertificateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationFabricsClientRenewCertificateResponse], errResp azfake.ErrorResponder) + BeginRenewCertificate func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, renewCertificate armrecoveryservicessiterecovery.RenewCertificateInput, options *armrecoveryservicessiterecovery.ReplicationFabricsClientBeginRenewCertificateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationFabricsClientRenewCertificateResponse], errResp azfake.ErrorResponder) } // NewReplicationFabricsServerTransport creates a new instance of ReplicationFabricsServerTransport with the provided implementation. @@ -153,11 +153,11 @@ func (r *ReplicationFabricsServerTransport) dispatchBeginCheckConsistency(req *h if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -165,7 +165,7 @@ func (r *ReplicationFabricsServerTransport) dispatchBeginCheckConsistency(req *h if err != nil { return nil, err } - respr, errRespr := r.srv.BeginCheckConsistency(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, nil) + respr, errRespr := r.srv.BeginCheckConsistency(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -205,11 +205,11 @@ func (r *ReplicationFabricsServerTransport) dispatchBeginCreate(req *http.Reques if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -217,7 +217,7 @@ func (r *ReplicationFabricsServerTransport) dispatchBeginCreate(req *http.Reques if err != nil { return nil, err } - respr, errRespr := r.srv.BeginCreate(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, body, nil) + respr, errRespr := r.srv.BeginCreate(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -253,11 +253,11 @@ func (r *ReplicationFabricsServerTransport) dispatchBeginDelete(req *http.Reques if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -265,7 +265,7 @@ func (r *ReplicationFabricsServerTransport) dispatchBeginDelete(req *http.Reques if err != nil { return nil, err } - respr, errRespr := r.srv.BeginDelete(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, nil) + respr, errRespr := r.srv.BeginDelete(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -300,11 +300,11 @@ func (r *ReplicationFabricsServerTransport) dispatchGet(req *http.Request) (*htt return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } qp := req.URL.Query() - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -323,7 +323,7 @@ func (r *ReplicationFabricsServerTransport) dispatchGet(req *http.Request) (*htt Filter: filterParam, } } - respr, errRespr := r.srv.Get(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, options) + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, options) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -350,15 +350,15 @@ func (r *ReplicationFabricsServerTransport) dispatchNewListPager(req *http.Reque if matches == nil || len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } - resp := r.srv.NewListPager(resourceNameParam, resourceGroupNameParam, nil) + resp := r.srv.NewListPager(resourceGroupNameParam, resourceNameParam, nil) newListPager = &resp r.newListPager.add(req, newListPager) server.PagerResponderInjectNextLinks(newListPager, req, func(page *armrecoveryservicessiterecovery.ReplicationFabricsClientListResponse, createLink func() string) { @@ -391,11 +391,11 @@ func (r *ReplicationFabricsServerTransport) dispatchBeginMigrateToAAD(req *http. if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -403,7 +403,7 @@ func (r *ReplicationFabricsServerTransport) dispatchBeginMigrateToAAD(req *http. if err != nil { return nil, err } - respr, errRespr := r.srv.BeginMigrateToAAD(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, nil) + respr, errRespr := r.srv.BeginMigrateToAAD(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -439,11 +439,11 @@ func (r *ReplicationFabricsServerTransport) dispatchBeginPurge(req *http.Request if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -451,7 +451,7 @@ func (r *ReplicationFabricsServerTransport) dispatchBeginPurge(req *http.Request if err != nil { return nil, err } - respr, errRespr := r.srv.BeginPurge(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, nil) + respr, errRespr := r.srv.BeginPurge(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -491,11 +491,11 @@ func (r *ReplicationFabricsServerTransport) dispatchBeginReassociateGateway(req if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -503,7 +503,7 @@ func (r *ReplicationFabricsServerTransport) dispatchBeginReassociateGateway(req if err != nil { return nil, err } - respr, errRespr := r.srv.BeginReassociateGateway(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, body, nil) + respr, errRespr := r.srv.BeginReassociateGateway(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -591,11 +591,11 @@ func (r *ReplicationFabricsServerTransport) dispatchBeginRenewCertificate(req *h if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -603,7 +603,7 @@ func (r *ReplicationFabricsServerTransport) dispatchBeginRenewCertificate(req *h if err != nil { return nil, err } - respr, errRespr := r.srv.BeginRenewCertificate(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, body, nil) + respr, errRespr := r.srv.BeginRenewCertificate(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationjobs_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationjobs_server.go index 2deb61ac9211..3104b7ba2ea7 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationjobs_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationjobs_server.go @@ -26,27 +26,27 @@ import ( type ReplicationJobsServer struct { // BeginCancel is the fake for method ReplicationJobsClient.BeginCancel // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginCancel func(ctx context.Context, resourceName string, resourceGroupName string, jobName string, options *armrecoveryservicessiterecovery.ReplicationJobsClientBeginCancelOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationJobsClientCancelResponse], errResp azfake.ErrorResponder) + BeginCancel func(ctx context.Context, resourceGroupName string, resourceName string, jobName string, options *armrecoveryservicessiterecovery.ReplicationJobsClientBeginCancelOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationJobsClientCancelResponse], errResp azfake.ErrorResponder) // BeginExport is the fake for method ReplicationJobsClient.BeginExport // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginExport func(ctx context.Context, resourceName string, resourceGroupName string, jobQueryParameter armrecoveryservicessiterecovery.JobQueryParameter, options *armrecoveryservicessiterecovery.ReplicationJobsClientBeginExportOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationJobsClientExportResponse], errResp azfake.ErrorResponder) + BeginExport func(ctx context.Context, resourceGroupName string, resourceName string, jobQueryParameter armrecoveryservicessiterecovery.JobQueryParameter, options *armrecoveryservicessiterecovery.ReplicationJobsClientBeginExportOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationJobsClientExportResponse], errResp azfake.ErrorResponder) // Get is the fake for method ReplicationJobsClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceName string, resourceGroupName string, jobName string, options *armrecoveryservicessiterecovery.ReplicationJobsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationJobsClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, resourceName string, jobName string, options *armrecoveryservicessiterecovery.ReplicationJobsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationJobsClientGetResponse], errResp azfake.ErrorResponder) // NewListPager is the fake for method ReplicationJobsClient.NewListPager // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceName string, resourceGroupName string, options *armrecoveryservicessiterecovery.ReplicationJobsClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationJobsClientListResponse]) + NewListPager func(resourceGroupName string, resourceName string, options *armrecoveryservicessiterecovery.ReplicationJobsClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationJobsClientListResponse]) // BeginRestart is the fake for method ReplicationJobsClient.BeginRestart // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginRestart func(ctx context.Context, resourceName string, resourceGroupName string, jobName string, options *armrecoveryservicessiterecovery.ReplicationJobsClientBeginRestartOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationJobsClientRestartResponse], errResp azfake.ErrorResponder) + BeginRestart func(ctx context.Context, resourceGroupName string, resourceName string, jobName string, options *armrecoveryservicessiterecovery.ReplicationJobsClientBeginRestartOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationJobsClientRestartResponse], errResp azfake.ErrorResponder) // BeginResume is the fake for method ReplicationJobsClient.BeginResume // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginResume func(ctx context.Context, resourceName string, resourceGroupName string, jobName string, resumeJobParams armrecoveryservicessiterecovery.ResumeJobParams, options *armrecoveryservicessiterecovery.ReplicationJobsClientBeginResumeOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationJobsClientResumeResponse], errResp azfake.ErrorResponder) + BeginResume func(ctx context.Context, resourceGroupName string, resourceName string, jobName string, resumeJobParams armrecoveryservicessiterecovery.ResumeJobParams, options *armrecoveryservicessiterecovery.ReplicationJobsClientBeginResumeOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationJobsClientResumeResponse], errResp azfake.ErrorResponder) } // NewReplicationJobsServerTransport creates a new instance of ReplicationJobsServerTransport with the provided implementation. @@ -121,11 +121,11 @@ func (r *ReplicationJobsServerTransport) dispatchBeginCancel(req *http.Request) if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -133,7 +133,7 @@ func (r *ReplicationJobsServerTransport) dispatchBeginCancel(req *http.Request) if err != nil { return nil, err } - respr, errRespr := r.srv.BeginCancel(req.Context(), resourceNameParam, resourceGroupNameParam, jobNameParam, nil) + respr, errRespr := r.srv.BeginCancel(req.Context(), resourceGroupNameParam, resourceNameParam, jobNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -173,15 +173,15 @@ func (r *ReplicationJobsServerTransport) dispatchBeginExport(req *http.Request) if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } - respr, errRespr := r.srv.BeginExport(req.Context(), resourceNameParam, resourceGroupNameParam, body, nil) + respr, errRespr := r.srv.BeginExport(req.Context(), resourceGroupNameParam, resourceNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -215,11 +215,11 @@ func (r *ReplicationJobsServerTransport) dispatchGet(req *http.Request) (*http.R if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -227,7 +227,7 @@ func (r *ReplicationJobsServerTransport) dispatchGet(req *http.Request) (*http.R if err != nil { return nil, err } - respr, errRespr := r.srv.Get(req.Context(), resourceNameParam, resourceGroupNameParam, jobNameParam, nil) + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, jobNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -255,11 +255,11 @@ func (r *ReplicationJobsServerTransport) dispatchNewListPager(req *http.Request) return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } qp := req.URL.Query() - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -274,7 +274,7 @@ func (r *ReplicationJobsServerTransport) dispatchNewListPager(req *http.Request) Filter: filterParam, } } - resp := r.srv.NewListPager(resourceNameParam, resourceGroupNameParam, options) + resp := r.srv.NewListPager(resourceGroupNameParam, resourceNameParam, options) newListPager = &resp r.newListPager.add(req, newListPager) server.PagerResponderInjectNextLinks(newListPager, req, func(page *armrecoveryservicessiterecovery.ReplicationJobsClientListResponse, createLink func() string) { @@ -307,11 +307,11 @@ func (r *ReplicationJobsServerTransport) dispatchBeginRestart(req *http.Request) if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -319,7 +319,7 @@ func (r *ReplicationJobsServerTransport) dispatchBeginRestart(req *http.Request) if err != nil { return nil, err } - respr, errRespr := r.srv.BeginRestart(req.Context(), resourceNameParam, resourceGroupNameParam, jobNameParam, nil) + respr, errRespr := r.srv.BeginRestart(req.Context(), resourceGroupNameParam, resourceNameParam, jobNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -359,11 +359,11 @@ func (r *ReplicationJobsServerTransport) dispatchBeginResume(req *http.Request) if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -371,7 +371,7 @@ func (r *ReplicationJobsServerTransport) dispatchBeginResume(req *http.Request) if err != nil { return nil, err } - respr, errRespr := r.srv.BeginResume(req.Context(), resourceNameParam, resourceGroupNameParam, jobNameParam, body, nil) + respr, errRespr := r.srv.BeginResume(req.Context(), resourceGroupNameParam, resourceNameParam, jobNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationlogicalnetworks_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationlogicalnetworks_server.go index f60c9e92d3d1..0f00d9e3b5fc 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationlogicalnetworks_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationlogicalnetworks_server.go @@ -26,11 +26,11 @@ import ( type ReplicationLogicalNetworksServer struct { // Get is the fake for method ReplicationLogicalNetworksClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, logicalNetworkName string, options *armrecoveryservicessiterecovery.ReplicationLogicalNetworksClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationLogicalNetworksClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, logicalNetworkName string, options *armrecoveryservicessiterecovery.ReplicationLogicalNetworksClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationLogicalNetworksClientGetResponse], errResp azfake.ErrorResponder) // NewListByReplicationFabricsPager is the fake for method ReplicationLogicalNetworksClient.NewListByReplicationFabricsPager // HTTP status codes to indicate success: http.StatusOK - NewListByReplicationFabricsPager func(resourceName string, resourceGroupName string, fabricName string, options *armrecoveryservicessiterecovery.ReplicationLogicalNetworksClientListByReplicationFabricsOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationLogicalNetworksClientListByReplicationFabricsResponse]) + NewListByReplicationFabricsPager func(resourceGroupName string, resourceName string, fabricName string, options *armrecoveryservicessiterecovery.ReplicationLogicalNetworksClientListByReplicationFabricsOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationLogicalNetworksClientListByReplicationFabricsResponse]) } // NewReplicationLogicalNetworksServerTransport creates a new instance of ReplicationLogicalNetworksServerTransport with the provided implementation. @@ -87,11 +87,11 @@ func (r *ReplicationLogicalNetworksServerTransport) dispatchGet(req *http.Reques if matches == nil || len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -103,7 +103,7 @@ func (r *ReplicationLogicalNetworksServerTransport) dispatchGet(req *http.Reques if err != nil { return nil, err } - respr, errRespr := r.srv.Get(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, logicalNetworkNameParam, nil) + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, logicalNetworkNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -130,11 +130,11 @@ func (r *ReplicationLogicalNetworksServerTransport) dispatchNewListByReplication if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -142,7 +142,7 @@ func (r *ReplicationLogicalNetworksServerTransport) dispatchNewListByReplication if err != nil { return nil, err } - resp := r.srv.NewListByReplicationFabricsPager(resourceNameParam, resourceGroupNameParam, fabricNameParam, nil) + resp := r.srv.NewListByReplicationFabricsPager(resourceGroupNameParam, resourceNameParam, fabricNameParam, nil) newListByReplicationFabricsPager = &resp r.newListByReplicationFabricsPager.add(req, newListByReplicationFabricsPager) server.PagerResponderInjectNextLinks(newListByReplicationFabricsPager, req, func(page *armrecoveryservicessiterecovery.ReplicationLogicalNetworksClientListByReplicationFabricsResponse, createLink func() string) { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationmigrationitems_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationmigrationitems_server.go index 12ff86daf43e..cdcc75ec3567 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationmigrationitems_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationmigrationitems_server.go @@ -26,51 +26,51 @@ import ( type ReplicationMigrationItemsServer struct { // BeginCreate is the fake for method ReplicationMigrationItemsClient.BeginCreate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginCreate func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, input armrecoveryservicessiterecovery.EnableMigrationInput, options *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationMigrationItemsClientCreateResponse], errResp azfake.ErrorResponder) + BeginCreate func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, input armrecoveryservicessiterecovery.EnableMigrationInput, options *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationMigrationItemsClientCreateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method ReplicationMigrationItemsClient.BeginDelete // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, options *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientBeginDeleteOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationMigrationItemsClientDeleteResponse], errResp azfake.ErrorResponder) + BeginDelete func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, options *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientBeginDeleteOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationMigrationItemsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method ReplicationMigrationItemsClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, options *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationMigrationItemsClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, options *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationMigrationItemsClientGetResponse], errResp azfake.ErrorResponder) // NewListPager is the fake for method ReplicationMigrationItemsClient.NewListPager // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceName string, resourceGroupName string, options *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationMigrationItemsClientListResponse]) + NewListPager func(resourceGroupName string, resourceName string, options *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationMigrationItemsClientListResponse]) // NewListByReplicationProtectionContainersPager is the fake for method ReplicationMigrationItemsClient.NewListByReplicationProtectionContainersPager // HTTP status codes to indicate success: http.StatusOK - NewListByReplicationProtectionContainersPager func(resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, options *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientListByReplicationProtectionContainersOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationMigrationItemsClientListByReplicationProtectionContainersResponse]) + NewListByReplicationProtectionContainersPager func(resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, options *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientListByReplicationProtectionContainersOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationMigrationItemsClientListByReplicationProtectionContainersResponse]) // BeginMigrate is the fake for method ReplicationMigrationItemsClient.BeginMigrate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginMigrate func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, migrateInput armrecoveryservicessiterecovery.MigrateInput, options *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientBeginMigrateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationMigrationItemsClientMigrateResponse], errResp azfake.ErrorResponder) + BeginMigrate func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, migrateInput armrecoveryservicessiterecovery.MigrateInput, options *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientBeginMigrateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationMigrationItemsClientMigrateResponse], errResp azfake.ErrorResponder) // BeginPauseReplication is the fake for method ReplicationMigrationItemsClient.BeginPauseReplication // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginPauseReplication func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, pauseReplicationInput armrecoveryservicessiterecovery.PauseReplicationInput, options *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientBeginPauseReplicationOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationMigrationItemsClientPauseReplicationResponse], errResp azfake.ErrorResponder) + BeginPauseReplication func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, pauseReplicationInput armrecoveryservicessiterecovery.PauseReplicationInput, options *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientBeginPauseReplicationOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationMigrationItemsClientPauseReplicationResponse], errResp azfake.ErrorResponder) // BeginResumeReplication is the fake for method ReplicationMigrationItemsClient.BeginResumeReplication // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginResumeReplication func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, resumeReplicationInput armrecoveryservicessiterecovery.ResumeReplicationInput, options *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientBeginResumeReplicationOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationMigrationItemsClientResumeReplicationResponse], errResp azfake.ErrorResponder) + BeginResumeReplication func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, resumeReplicationInput armrecoveryservicessiterecovery.ResumeReplicationInput, options *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientBeginResumeReplicationOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationMigrationItemsClientResumeReplicationResponse], errResp azfake.ErrorResponder) // BeginResync is the fake for method ReplicationMigrationItemsClient.BeginResync // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginResync func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, input armrecoveryservicessiterecovery.ResyncInput, options *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientBeginResyncOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationMigrationItemsClientResyncResponse], errResp azfake.ErrorResponder) + BeginResync func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, input armrecoveryservicessiterecovery.ResyncInput, options *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientBeginResyncOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationMigrationItemsClientResyncResponse], errResp azfake.ErrorResponder) // BeginTestMigrate is the fake for method ReplicationMigrationItemsClient.BeginTestMigrate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginTestMigrate func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput armrecoveryservicessiterecovery.TestMigrateInput, options *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientBeginTestMigrateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationMigrationItemsClientTestMigrateResponse], errResp azfake.ErrorResponder) + BeginTestMigrate func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput armrecoveryservicessiterecovery.TestMigrateInput, options *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientBeginTestMigrateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationMigrationItemsClientTestMigrateResponse], errResp azfake.ErrorResponder) // BeginTestMigrateCleanup is the fake for method ReplicationMigrationItemsClient.BeginTestMigrateCleanup // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginTestMigrateCleanup func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput armrecoveryservicessiterecovery.TestMigrateCleanupInput, options *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientBeginTestMigrateCleanupOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationMigrationItemsClientTestMigrateCleanupResponse], errResp azfake.ErrorResponder) + BeginTestMigrateCleanup func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput armrecoveryservicessiterecovery.TestMigrateCleanupInput, options *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientBeginTestMigrateCleanupOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationMigrationItemsClientTestMigrateCleanupResponse], errResp azfake.ErrorResponder) // BeginUpdate is the fake for method ReplicationMigrationItemsClient.BeginUpdate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdate func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, input armrecoveryservicessiterecovery.UpdateMigrationItemInput, options *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientBeginUpdateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationMigrationItemsClientUpdateResponse], errResp azfake.ErrorResponder) + BeginUpdate func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, input armrecoveryservicessiterecovery.UpdateMigrationItemInput, options *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientBeginUpdateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationMigrationItemsClientUpdateResponse], errResp azfake.ErrorResponder) } // NewReplicationMigrationItemsServerTransport creates a new instance of ReplicationMigrationItemsServerTransport with the provided implementation. @@ -173,11 +173,11 @@ func (r *ReplicationMigrationItemsServerTransport) dispatchBeginCreate(req *http if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -193,7 +193,7 @@ func (r *ReplicationMigrationItemsServerTransport) dispatchBeginCreate(req *http if err != nil { return nil, err } - respr, errRespr := r.srv.BeginCreate(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, migrationItemNameParam, body, nil) + respr, errRespr := r.srv.BeginCreate(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, migrationItemNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -230,11 +230,11 @@ func (r *ReplicationMigrationItemsServerTransport) dispatchBeginDelete(req *http return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } qp := req.URL.Query() - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -261,7 +261,7 @@ func (r *ReplicationMigrationItemsServerTransport) dispatchBeginDelete(req *http DeleteOption: deleteOptionParam, } } - respr, errRespr := r.srv.BeginDelete(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, migrationItemNameParam, options) + respr, errRespr := r.srv.BeginDelete(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, migrationItemNameParam, options) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -295,11 +295,11 @@ func (r *ReplicationMigrationItemsServerTransport) dispatchGet(req *http.Request if matches == nil || len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -315,7 +315,7 @@ func (r *ReplicationMigrationItemsServerTransport) dispatchGet(req *http.Request if err != nil { return nil, err } - respr, errRespr := r.srv.Get(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, migrationItemNameParam, nil) + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, migrationItemNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -343,11 +343,11 @@ func (r *ReplicationMigrationItemsServerTransport) dispatchNewListPager(req *htt return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } qp := req.URL.Query() - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -374,7 +374,7 @@ func (r *ReplicationMigrationItemsServerTransport) dispatchNewListPager(req *htt Filter: filterParam, } } - resp := r.srv.NewListPager(resourceNameParam, resourceGroupNameParam, options) + resp := r.srv.NewListPager(resourceGroupNameParam, resourceNameParam, options) newListPager = &resp r.newListPager.add(req, newListPager) server.PagerResponderInjectNextLinks(newListPager, req, func(page *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientListResponse, createLink func() string) { @@ -408,11 +408,11 @@ func (r *ReplicationMigrationItemsServerTransport) dispatchNewListByReplicationP return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } qp := req.URL.Query() - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -447,7 +447,7 @@ func (r *ReplicationMigrationItemsServerTransport) dispatchNewListByReplicationP Filter: filterParam, } } - resp := r.srv.NewListByReplicationProtectionContainersPager(resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, options) + resp := r.srv.NewListByReplicationProtectionContainersPager(resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, options) newListByReplicationProtectionContainersPager = &resp r.newListByReplicationProtectionContainersPager.add(req, newListByReplicationProtectionContainersPager) server.PagerResponderInjectNextLinks(newListByReplicationProtectionContainersPager, req, func(page *armrecoveryservicessiterecovery.ReplicationMigrationItemsClientListByReplicationProtectionContainersResponse, createLink func() string) { @@ -484,11 +484,11 @@ func (r *ReplicationMigrationItemsServerTransport) dispatchBeginMigrate(req *htt if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -504,7 +504,7 @@ func (r *ReplicationMigrationItemsServerTransport) dispatchBeginMigrate(req *htt if err != nil { return nil, err } - respr, errRespr := r.srv.BeginMigrate(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, migrationItemNameParam, body, nil) + respr, errRespr := r.srv.BeginMigrate(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, migrationItemNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -544,11 +544,11 @@ func (r *ReplicationMigrationItemsServerTransport) dispatchBeginPauseReplication if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -564,7 +564,7 @@ func (r *ReplicationMigrationItemsServerTransport) dispatchBeginPauseReplication if err != nil { return nil, err } - respr, errRespr := r.srv.BeginPauseReplication(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, migrationItemNameParam, body, nil) + respr, errRespr := r.srv.BeginPauseReplication(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, migrationItemNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -604,11 +604,11 @@ func (r *ReplicationMigrationItemsServerTransport) dispatchBeginResumeReplicatio if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -624,7 +624,7 @@ func (r *ReplicationMigrationItemsServerTransport) dispatchBeginResumeReplicatio if err != nil { return nil, err } - respr, errRespr := r.srv.BeginResumeReplication(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, migrationItemNameParam, body, nil) + respr, errRespr := r.srv.BeginResumeReplication(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, migrationItemNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -664,11 +664,11 @@ func (r *ReplicationMigrationItemsServerTransport) dispatchBeginResync(req *http if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -684,7 +684,7 @@ func (r *ReplicationMigrationItemsServerTransport) dispatchBeginResync(req *http if err != nil { return nil, err } - respr, errRespr := r.srv.BeginResync(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, migrationItemNameParam, body, nil) + respr, errRespr := r.srv.BeginResync(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, migrationItemNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -724,11 +724,11 @@ func (r *ReplicationMigrationItemsServerTransport) dispatchBeginTestMigrate(req if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -744,7 +744,7 @@ func (r *ReplicationMigrationItemsServerTransport) dispatchBeginTestMigrate(req if err != nil { return nil, err } - respr, errRespr := r.srv.BeginTestMigrate(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, migrationItemNameParam, body, nil) + respr, errRespr := r.srv.BeginTestMigrate(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, migrationItemNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -784,11 +784,11 @@ func (r *ReplicationMigrationItemsServerTransport) dispatchBeginTestMigrateClean if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -804,7 +804,7 @@ func (r *ReplicationMigrationItemsServerTransport) dispatchBeginTestMigrateClean if err != nil { return nil, err } - respr, errRespr := r.srv.BeginTestMigrateCleanup(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, migrationItemNameParam, body, nil) + respr, errRespr := r.srv.BeginTestMigrateCleanup(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, migrationItemNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -844,11 +844,11 @@ func (r *ReplicationMigrationItemsServerTransport) dispatchBeginUpdate(req *http if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -864,7 +864,7 @@ func (r *ReplicationMigrationItemsServerTransport) dispatchBeginUpdate(req *http if err != nil { return nil, err } - respr, errRespr := r.srv.BeginUpdate(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, migrationItemNameParam, body, nil) + respr, errRespr := r.srv.BeginUpdate(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, migrationItemNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationnetworkmappings_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationnetworkmappings_server.go index 44e41c2f7100..de59be1ab973 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationnetworkmappings_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationnetworkmappings_server.go @@ -26,27 +26,27 @@ import ( type ReplicationNetworkMappingsServer struct { // BeginCreate is the fake for method ReplicationNetworkMappingsClient.BeginCreate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginCreate func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, networkName string, networkMappingName string, input armrecoveryservicessiterecovery.CreateNetworkMappingInput, options *armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientCreateResponse], errResp azfake.ErrorResponder) + BeginCreate func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, networkName string, networkMappingName string, input armrecoveryservicessiterecovery.CreateNetworkMappingInput, options *armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientCreateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method ReplicationNetworkMappingsClient.BeginDelete // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, networkName string, networkMappingName string, options *armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientBeginDeleteOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientDeleteResponse], errResp azfake.ErrorResponder) + BeginDelete func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, networkName string, networkMappingName string, options *armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientBeginDeleteOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method ReplicationNetworkMappingsClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, networkName string, networkMappingName string, options *armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, networkName string, networkMappingName string, options *armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientGetResponse], errResp azfake.ErrorResponder) // NewListPager is the fake for method ReplicationNetworkMappingsClient.NewListPager // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceName string, resourceGroupName string, options *armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientListResponse]) + NewListPager func(resourceGroupName string, resourceName string, options *armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientListResponse]) // NewListByReplicationNetworksPager is the fake for method ReplicationNetworkMappingsClient.NewListByReplicationNetworksPager // HTTP status codes to indicate success: http.StatusOK - NewListByReplicationNetworksPager func(resourceName string, resourceGroupName string, fabricName string, networkName string, options *armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientListByReplicationNetworksOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientListByReplicationNetworksResponse]) + NewListByReplicationNetworksPager func(resourceGroupName string, resourceName string, fabricName string, networkName string, options *armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientListByReplicationNetworksOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientListByReplicationNetworksResponse]) // BeginUpdate is the fake for method ReplicationNetworkMappingsClient.BeginUpdate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdate func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, networkName string, networkMappingName string, input armrecoveryservicessiterecovery.UpdateNetworkMappingInput, options *armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientBeginUpdateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientUpdateResponse], errResp azfake.ErrorResponder) + BeginUpdate func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, networkName string, networkMappingName string, input armrecoveryservicessiterecovery.UpdateNetworkMappingInput, options *armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientBeginUpdateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientUpdateResponse], errResp azfake.ErrorResponder) } // NewReplicationNetworkMappingsServerTransport creates a new instance of ReplicationNetworkMappingsServerTransport with the provided implementation. @@ -125,11 +125,11 @@ func (r *ReplicationNetworkMappingsServerTransport) dispatchBeginCreate(req *htt if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -145,7 +145,7 @@ func (r *ReplicationNetworkMappingsServerTransport) dispatchBeginCreate(req *htt if err != nil { return nil, err } - respr, errRespr := r.srv.BeginCreate(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, networkNameParam, networkMappingNameParam, body, nil) + respr, errRespr := r.srv.BeginCreate(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, networkNameParam, networkMappingNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -181,11 +181,11 @@ func (r *ReplicationNetworkMappingsServerTransport) dispatchBeginDelete(req *htt if matches == nil || len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -201,7 +201,7 @@ func (r *ReplicationNetworkMappingsServerTransport) dispatchBeginDelete(req *htt if err != nil { return nil, err } - respr, errRespr := r.srv.BeginDelete(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, networkNameParam, networkMappingNameParam, nil) + respr, errRespr := r.srv.BeginDelete(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, networkNameParam, networkMappingNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -235,11 +235,11 @@ func (r *ReplicationNetworkMappingsServerTransport) dispatchGet(req *http.Reques if matches == nil || len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -255,7 +255,7 @@ func (r *ReplicationNetworkMappingsServerTransport) dispatchGet(req *http.Reques if err != nil { return nil, err } - respr, errRespr := r.srv.Get(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, networkNameParam, networkMappingNameParam, nil) + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, networkNameParam, networkMappingNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -282,15 +282,15 @@ func (r *ReplicationNetworkMappingsServerTransport) dispatchNewListPager(req *ht if matches == nil || len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } - resp := r.srv.NewListPager(resourceNameParam, resourceGroupNameParam, nil) + resp := r.srv.NewListPager(resourceGroupNameParam, resourceNameParam, nil) newListPager = &resp r.newListPager.add(req, newListPager) server.PagerResponderInjectNextLinks(newListPager, req, func(page *armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientListResponse, createLink func() string) { @@ -323,11 +323,11 @@ func (r *ReplicationNetworkMappingsServerTransport) dispatchNewListByReplication if matches == nil || len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -339,7 +339,7 @@ func (r *ReplicationNetworkMappingsServerTransport) dispatchNewListByReplication if err != nil { return nil, err } - resp := r.srv.NewListByReplicationNetworksPager(resourceNameParam, resourceGroupNameParam, fabricNameParam, networkNameParam, nil) + resp := r.srv.NewListByReplicationNetworksPager(resourceGroupNameParam, resourceNameParam, fabricNameParam, networkNameParam, nil) newListByReplicationNetworksPager = &resp r.newListByReplicationNetworksPager.add(req, newListByReplicationNetworksPager) server.PagerResponderInjectNextLinks(newListByReplicationNetworksPager, req, func(page *armrecoveryservicessiterecovery.ReplicationNetworkMappingsClientListByReplicationNetworksResponse, createLink func() string) { @@ -376,11 +376,11 @@ func (r *ReplicationNetworkMappingsServerTransport) dispatchBeginUpdate(req *htt if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -396,7 +396,7 @@ func (r *ReplicationNetworkMappingsServerTransport) dispatchBeginUpdate(req *htt if err != nil { return nil, err } - respr, errRespr := r.srv.BeginUpdate(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, networkNameParam, networkMappingNameParam, body, nil) + respr, errRespr := r.srv.BeginUpdate(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, networkNameParam, networkMappingNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationnetworks_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationnetworks_server.go index 88d19e907866..52d0d15d84d1 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationnetworks_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationnetworks_server.go @@ -26,15 +26,15 @@ import ( type ReplicationNetworksServer struct { // Get is the fake for method ReplicationNetworksClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, networkName string, options *armrecoveryservicessiterecovery.ReplicationNetworksClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationNetworksClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, networkName string, options *armrecoveryservicessiterecovery.ReplicationNetworksClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationNetworksClientGetResponse], errResp azfake.ErrorResponder) // NewListPager is the fake for method ReplicationNetworksClient.NewListPager // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceName string, resourceGroupName string, options *armrecoveryservicessiterecovery.ReplicationNetworksClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationNetworksClientListResponse]) + NewListPager func(resourceGroupName string, resourceName string, options *armrecoveryservicessiterecovery.ReplicationNetworksClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationNetworksClientListResponse]) // NewListByReplicationFabricsPager is the fake for method ReplicationNetworksClient.NewListByReplicationFabricsPager // HTTP status codes to indicate success: http.StatusOK - NewListByReplicationFabricsPager func(resourceName string, resourceGroupName string, fabricName string, options *armrecoveryservicessiterecovery.ReplicationNetworksClientListByReplicationFabricsOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationNetworksClientListByReplicationFabricsResponse]) + NewListByReplicationFabricsPager func(resourceGroupName string, resourceName string, fabricName string, options *armrecoveryservicessiterecovery.ReplicationNetworksClientListByReplicationFabricsOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationNetworksClientListByReplicationFabricsResponse]) } // NewReplicationNetworksServerTransport creates a new instance of ReplicationNetworksServerTransport with the provided implementation. @@ -95,11 +95,11 @@ func (r *ReplicationNetworksServerTransport) dispatchGet(req *http.Request) (*ht if matches == nil || len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -111,7 +111,7 @@ func (r *ReplicationNetworksServerTransport) dispatchGet(req *http.Request) (*ht if err != nil { return nil, err } - respr, errRespr := r.srv.Get(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, networkNameParam, nil) + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, networkNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -138,15 +138,15 @@ func (r *ReplicationNetworksServerTransport) dispatchNewListPager(req *http.Requ if matches == nil || len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } - resp := r.srv.NewListPager(resourceNameParam, resourceGroupNameParam, nil) + resp := r.srv.NewListPager(resourceGroupNameParam, resourceNameParam, nil) newListPager = &resp r.newListPager.add(req, newListPager) server.PagerResponderInjectNextLinks(newListPager, req, func(page *armrecoveryservicessiterecovery.ReplicationNetworksClientListResponse, createLink func() string) { @@ -179,11 +179,11 @@ func (r *ReplicationNetworksServerTransport) dispatchNewListByReplicationFabrics if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -191,7 +191,7 @@ func (r *ReplicationNetworksServerTransport) dispatchNewListByReplicationFabrics if err != nil { return nil, err } - resp := r.srv.NewListByReplicationFabricsPager(resourceNameParam, resourceGroupNameParam, fabricNameParam, nil) + resp := r.srv.NewListByReplicationFabricsPager(resourceGroupNameParam, resourceNameParam, fabricNameParam, nil) newListByReplicationFabricsPager = &resp r.newListByReplicationFabricsPager.add(req, newListByReplicationFabricsPager) server.PagerResponderInjectNextLinks(newListByReplicationFabricsPager, req, func(page *armrecoveryservicessiterecovery.ReplicationNetworksClientListByReplicationFabricsResponse, createLink func() string) { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationpolicies_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationpolicies_server.go index 919c0d8e4a35..45dd89381eec 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationpolicies_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationpolicies_server.go @@ -26,23 +26,23 @@ import ( type ReplicationPoliciesServer struct { // BeginCreate is the fake for method ReplicationPoliciesClient.BeginCreate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginCreate func(ctx context.Context, resourceName string, resourceGroupName string, policyName string, input armrecoveryservicessiterecovery.CreatePolicyInput, options *armrecoveryservicessiterecovery.ReplicationPoliciesClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationPoliciesClientCreateResponse], errResp azfake.ErrorResponder) + BeginCreate func(ctx context.Context, resourceGroupName string, resourceName string, policyName string, input armrecoveryservicessiterecovery.CreatePolicyInput, options *armrecoveryservicessiterecovery.ReplicationPoliciesClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationPoliciesClientCreateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method ReplicationPoliciesClient.BeginDelete // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceName string, resourceGroupName string, policyName string, options *armrecoveryservicessiterecovery.ReplicationPoliciesClientBeginDeleteOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationPoliciesClientDeleteResponse], errResp azfake.ErrorResponder) + BeginDelete func(ctx context.Context, resourceGroupName string, resourceName string, policyName string, options *armrecoveryservicessiterecovery.ReplicationPoliciesClientBeginDeleteOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationPoliciesClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method ReplicationPoliciesClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceName string, resourceGroupName string, policyName string, options *armrecoveryservicessiterecovery.ReplicationPoliciesClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationPoliciesClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, resourceName string, policyName string, options *armrecoveryservicessiterecovery.ReplicationPoliciesClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationPoliciesClientGetResponse], errResp azfake.ErrorResponder) // NewListPager is the fake for method ReplicationPoliciesClient.NewListPager // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceName string, resourceGroupName string, options *armrecoveryservicessiterecovery.ReplicationPoliciesClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationPoliciesClientListResponse]) + NewListPager func(resourceGroupName string, resourceName string, options *armrecoveryservicessiterecovery.ReplicationPoliciesClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationPoliciesClientListResponse]) // BeginUpdate is the fake for method ReplicationPoliciesClient.BeginUpdate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdate func(ctx context.Context, resourceName string, resourceGroupName string, policyName string, input armrecoveryservicessiterecovery.UpdatePolicyInput, options *armrecoveryservicessiterecovery.ReplicationPoliciesClientBeginUpdateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationPoliciesClientUpdateResponse], errResp azfake.ErrorResponder) + BeginUpdate func(ctx context.Context, resourceGroupName string, resourceName string, policyName string, input armrecoveryservicessiterecovery.UpdatePolicyInput, options *armrecoveryservicessiterecovery.ReplicationPoliciesClientBeginUpdateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationPoliciesClientUpdateResponse], errResp azfake.ErrorResponder) } // NewReplicationPoliciesServerTransport creates a new instance of ReplicationPoliciesServerTransport with the provided implementation. @@ -117,11 +117,11 @@ func (r *ReplicationPoliciesServerTransport) dispatchBeginCreate(req *http.Reque if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -129,7 +129,7 @@ func (r *ReplicationPoliciesServerTransport) dispatchBeginCreate(req *http.Reque if err != nil { return nil, err } - respr, errRespr := r.srv.BeginCreate(req.Context(), resourceNameParam, resourceGroupNameParam, policyNameParam, body, nil) + respr, errRespr := r.srv.BeginCreate(req.Context(), resourceGroupNameParam, resourceNameParam, policyNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -165,11 +165,11 @@ func (r *ReplicationPoliciesServerTransport) dispatchBeginDelete(req *http.Reque if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -177,7 +177,7 @@ func (r *ReplicationPoliciesServerTransport) dispatchBeginDelete(req *http.Reque if err != nil { return nil, err } - respr, errRespr := r.srv.BeginDelete(req.Context(), resourceNameParam, resourceGroupNameParam, policyNameParam, nil) + respr, errRespr := r.srv.BeginDelete(req.Context(), resourceGroupNameParam, resourceNameParam, policyNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -211,11 +211,11 @@ func (r *ReplicationPoliciesServerTransport) dispatchGet(req *http.Request) (*ht if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -223,7 +223,7 @@ func (r *ReplicationPoliciesServerTransport) dispatchGet(req *http.Request) (*ht if err != nil { return nil, err } - respr, errRespr := r.srv.Get(req.Context(), resourceNameParam, resourceGroupNameParam, policyNameParam, nil) + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, policyNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -250,15 +250,15 @@ func (r *ReplicationPoliciesServerTransport) dispatchNewListPager(req *http.Requ if matches == nil || len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } - resp := r.srv.NewListPager(resourceNameParam, resourceGroupNameParam, nil) + resp := r.srv.NewListPager(resourceGroupNameParam, resourceNameParam, nil) newListPager = &resp r.newListPager.add(req, newListPager) server.PagerResponderInjectNextLinks(newListPager, req, func(page *armrecoveryservicessiterecovery.ReplicationPoliciesClientListResponse, createLink func() string) { @@ -295,11 +295,11 @@ func (r *ReplicationPoliciesServerTransport) dispatchBeginUpdate(req *http.Reque if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -307,7 +307,7 @@ func (r *ReplicationPoliciesServerTransport) dispatchBeginUpdate(req *http.Reque if err != nil { return nil, err } - respr, errRespr := r.srv.BeginUpdate(req.Context(), resourceNameParam, resourceGroupNameParam, policyNameParam, body, nil) + respr, errRespr := r.srv.BeginUpdate(req.Context(), resourceGroupNameParam, resourceNameParam, policyNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationprotectableitems_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationprotectableitems_server.go index 2b14bdda02fc..3a6557d1da31 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationprotectableitems_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationprotectableitems_server.go @@ -26,11 +26,11 @@ import ( type ReplicationProtectableItemsServer struct { // Get is the fake for method ReplicationProtectableItemsClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, protectableItemName string, options *armrecoveryservicessiterecovery.ReplicationProtectableItemsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationProtectableItemsClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, protectableItemName string, options *armrecoveryservicessiterecovery.ReplicationProtectableItemsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationProtectableItemsClientGetResponse], errResp azfake.ErrorResponder) // NewListByReplicationProtectionContainersPager is the fake for method ReplicationProtectableItemsClient.NewListByReplicationProtectionContainersPager // HTTP status codes to indicate success: http.StatusOK - NewListByReplicationProtectionContainersPager func(resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, options *armrecoveryservicessiterecovery.ReplicationProtectableItemsClientListByReplicationProtectionContainersOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectableItemsClientListByReplicationProtectionContainersResponse]) + NewListByReplicationProtectionContainersPager func(resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, options *armrecoveryservicessiterecovery.ReplicationProtectableItemsClientListByReplicationProtectionContainersOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectableItemsClientListByReplicationProtectionContainersResponse]) } // NewReplicationProtectableItemsServerTransport creates a new instance of ReplicationProtectableItemsServerTransport with the provided implementation. @@ -87,11 +87,11 @@ func (r *ReplicationProtectableItemsServerTransport) dispatchGet(req *http.Reque if matches == nil || len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -107,7 +107,7 @@ func (r *ReplicationProtectableItemsServerTransport) dispatchGet(req *http.Reque if err != nil { return nil, err } - respr, errRespr := r.srv.Get(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, protectableItemNameParam, nil) + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, protectableItemNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -135,11 +135,11 @@ func (r *ReplicationProtectableItemsServerTransport) dispatchNewListByReplicatio return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } qp := req.URL.Query() - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -174,7 +174,7 @@ func (r *ReplicationProtectableItemsServerTransport) dispatchNewListByReplicatio SkipToken: skipTokenParam, } } - resp := r.srv.NewListByReplicationProtectionContainersPager(resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, options) + resp := r.srv.NewListByReplicationProtectionContainersPager(resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, options) newListByReplicationProtectionContainersPager = &resp r.newListByReplicationProtectionContainersPager.add(req, newListByReplicationProtectionContainersPager) server.PagerResponderInjectNextLinks(newListByReplicationProtectionContainersPager, req, func(page *armrecoveryservicessiterecovery.ReplicationProtectableItemsClientListByReplicationProtectionContainersResponse, createLink func() string) { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationprotecteditems_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationprotecteditems_server.go index 1bbcf83499bf..b969f38f3c0d 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationprotecteditems_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationprotecteditems_server.go @@ -26,91 +26,91 @@ import ( type ReplicationProtectedItemsServer struct { // BeginAddDisks is the fake for method ReplicationProtectedItemsClient.BeginAddDisks // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginAddDisks func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput armrecoveryservicessiterecovery.AddDisksInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginAddDisksOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientAddDisksResponse], errResp azfake.ErrorResponder) + BeginAddDisks func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput armrecoveryservicessiterecovery.AddDisksInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginAddDisksOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientAddDisksResponse], errResp azfake.ErrorResponder) // BeginApplyRecoveryPoint is the fake for method ReplicationProtectedItemsClient.BeginApplyRecoveryPoint // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginApplyRecoveryPoint func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput armrecoveryservicessiterecovery.ApplyRecoveryPointInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginApplyRecoveryPointOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientApplyRecoveryPointResponse], errResp azfake.ErrorResponder) + BeginApplyRecoveryPoint func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput armrecoveryservicessiterecovery.ApplyRecoveryPointInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginApplyRecoveryPointOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientApplyRecoveryPointResponse], errResp azfake.ErrorResponder) // BeginCreate is the fake for method ReplicationProtectedItemsClient.BeginCreate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginCreate func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input armrecoveryservicessiterecovery.EnableProtectionInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientCreateResponse], errResp azfake.ErrorResponder) + BeginCreate func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input armrecoveryservicessiterecovery.EnableProtectionInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientCreateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method ReplicationProtectedItemsClient.BeginDelete // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput armrecoveryservicessiterecovery.DisableProtectionInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginDeleteOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientDeleteResponse], errResp azfake.ErrorResponder) + BeginDelete func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput armrecoveryservicessiterecovery.DisableProtectionInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginDeleteOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientDeleteResponse], errResp azfake.ErrorResponder) // BeginFailoverCancel is the fake for method ReplicationProtectedItemsClient.BeginFailoverCancel // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginFailoverCancel func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginFailoverCancelOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientFailoverCancelResponse], errResp azfake.ErrorResponder) + BeginFailoverCancel func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginFailoverCancelOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientFailoverCancelResponse], errResp azfake.ErrorResponder) // BeginFailoverCommit is the fake for method ReplicationProtectedItemsClient.BeginFailoverCommit // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginFailoverCommit func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginFailoverCommitOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientFailoverCommitResponse], errResp azfake.ErrorResponder) + BeginFailoverCommit func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginFailoverCommitOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientFailoverCommitResponse], errResp azfake.ErrorResponder) // Get is the fake for method ReplicationProtectedItemsClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientGetResponse], errResp azfake.ErrorResponder) // NewListPager is the fake for method ReplicationProtectedItemsClient.NewListPager // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceName string, resourceGroupName string, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientListResponse]) + NewListPager func(resourceGroupName string, resourceName string, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientListResponse]) // NewListByReplicationProtectionContainersPager is the fake for method ReplicationProtectedItemsClient.NewListByReplicationProtectionContainersPager // HTTP status codes to indicate success: http.StatusOK - NewListByReplicationProtectionContainersPager func(resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientListByReplicationProtectionContainersOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientListByReplicationProtectionContainersResponse]) + NewListByReplicationProtectionContainersPager func(resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientListByReplicationProtectionContainersOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientListByReplicationProtectionContainersResponse]) // BeginPlannedFailover is the fake for method ReplicationProtectedItemsClient.BeginPlannedFailover // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginPlannedFailover func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput armrecoveryservicessiterecovery.PlannedFailoverInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginPlannedFailoverOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientPlannedFailoverResponse], errResp azfake.ErrorResponder) + BeginPlannedFailover func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput armrecoveryservicessiterecovery.PlannedFailoverInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginPlannedFailoverOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientPlannedFailoverResponse], errResp azfake.ErrorResponder) // BeginPurge is the fake for method ReplicationProtectedItemsClient.BeginPurge // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginPurge func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginPurgeOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientPurgeResponse], errResp azfake.ErrorResponder) + BeginPurge func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginPurgeOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientPurgeResponse], errResp azfake.ErrorResponder) // BeginRemoveDisks is the fake for method ReplicationProtectedItemsClient.BeginRemoveDisks // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginRemoveDisks func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput armrecoveryservicessiterecovery.RemoveDisksInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginRemoveDisksOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientRemoveDisksResponse], errResp azfake.ErrorResponder) + BeginRemoveDisks func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput armrecoveryservicessiterecovery.RemoveDisksInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginRemoveDisksOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientRemoveDisksResponse], errResp azfake.ErrorResponder) // BeginRepairReplication is the fake for method ReplicationProtectedItemsClient.BeginRepairReplication // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginRepairReplication func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginRepairReplicationOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientRepairReplicationResponse], errResp azfake.ErrorResponder) + BeginRepairReplication func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginRepairReplicationOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientRepairReplicationResponse], errResp azfake.ErrorResponder) // BeginReprotect is the fake for method ReplicationProtectedItemsClient.BeginReprotect // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginReprotect func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput armrecoveryservicessiterecovery.ReverseReplicationInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginReprotectOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientReprotectResponse], errResp azfake.ErrorResponder) + BeginReprotect func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput armrecoveryservicessiterecovery.ReverseReplicationInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginReprotectOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientReprotectResponse], errResp azfake.ErrorResponder) // BeginResolveHealthErrors is the fake for method ReplicationProtectedItemsClient.BeginResolveHealthErrors // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginResolveHealthErrors func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput armrecoveryservicessiterecovery.ResolveHealthInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginResolveHealthErrorsOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientResolveHealthErrorsResponse], errResp azfake.ErrorResponder) + BeginResolveHealthErrors func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput armrecoveryservicessiterecovery.ResolveHealthInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginResolveHealthErrorsOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientResolveHealthErrorsResponse], errResp azfake.ErrorResponder) // BeginSwitchProvider is the fake for method ReplicationProtectedItemsClient.BeginSwitchProvider // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginSwitchProvider func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, switchProviderInput armrecoveryservicessiterecovery.SwitchProviderInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginSwitchProviderOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientSwitchProviderResponse], errResp azfake.ErrorResponder) + BeginSwitchProvider func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, switchProviderInput armrecoveryservicessiterecovery.SwitchProviderInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginSwitchProviderOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientSwitchProviderResponse], errResp azfake.ErrorResponder) // BeginTestFailover is the fake for method ReplicationProtectedItemsClient.BeginTestFailover // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginTestFailover func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput armrecoveryservicessiterecovery.TestFailoverInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginTestFailoverOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientTestFailoverResponse], errResp azfake.ErrorResponder) + BeginTestFailover func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput armrecoveryservicessiterecovery.TestFailoverInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginTestFailoverOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientTestFailoverResponse], errResp azfake.ErrorResponder) // BeginTestFailoverCleanup is the fake for method ReplicationProtectedItemsClient.BeginTestFailoverCleanup // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginTestFailoverCleanup func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput armrecoveryservicessiterecovery.TestFailoverCleanupInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginTestFailoverCleanupOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientTestFailoverCleanupResponse], errResp azfake.ErrorResponder) + BeginTestFailoverCleanup func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput armrecoveryservicessiterecovery.TestFailoverCleanupInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginTestFailoverCleanupOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientTestFailoverCleanupResponse], errResp azfake.ErrorResponder) // BeginUnplannedFailover is the fake for method ReplicationProtectedItemsClient.BeginUnplannedFailover // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUnplannedFailover func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput armrecoveryservicessiterecovery.UnplannedFailoverInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginUnplannedFailoverOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientUnplannedFailoverResponse], errResp azfake.ErrorResponder) + BeginUnplannedFailover func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput armrecoveryservicessiterecovery.UnplannedFailoverInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginUnplannedFailoverOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientUnplannedFailoverResponse], errResp azfake.ErrorResponder) // BeginUpdate is the fake for method ReplicationProtectedItemsClient.BeginUpdate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdate func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput armrecoveryservicessiterecovery.UpdateReplicationProtectedItemInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginUpdateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientUpdateResponse], errResp azfake.ErrorResponder) + BeginUpdate func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput armrecoveryservicessiterecovery.UpdateReplicationProtectedItemInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginUpdateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientUpdateResponse], errResp azfake.ErrorResponder) // BeginUpdateAppliance is the fake for method ReplicationProtectedItemsClient.BeginUpdateAppliance // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdateAppliance func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput armrecoveryservicessiterecovery.UpdateApplianceForReplicationProtectedItemInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginUpdateApplianceOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientUpdateApplianceResponse], errResp azfake.ErrorResponder) + BeginUpdateAppliance func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput armrecoveryservicessiterecovery.UpdateApplianceForReplicationProtectedItemInput, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginUpdateApplianceOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientUpdateApplianceResponse], errResp azfake.ErrorResponder) // BeginUpdateMobilityService is the fake for method ReplicationProtectedItemsClient.BeginUpdateMobilityService // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdateMobilityService func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateMobilityServiceRequest armrecoveryservicessiterecovery.UpdateMobilityServiceRequest, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginUpdateMobilityServiceOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientUpdateMobilityServiceResponse], errResp azfake.ErrorResponder) + BeginUpdateMobilityService func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateMobilityServiceRequest armrecoveryservicessiterecovery.UpdateMobilityServiceRequest, options *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientBeginUpdateMobilityServiceOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectedItemsClientUpdateMobilityServiceResponse], errResp azfake.ErrorResponder) } // NewReplicationProtectedItemsServerTransport creates a new instance of ReplicationProtectedItemsServerTransport with the provided implementation. @@ -253,11 +253,11 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginAddDisks(req *ht if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -273,7 +273,7 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginAddDisks(req *ht if err != nil { return nil, err } - respr, errRespr := r.srv.BeginAddDisks(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) + respr, errRespr := r.srv.BeginAddDisks(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -313,11 +313,11 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginApplyRecoveryPoi if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -333,7 +333,7 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginApplyRecoveryPoi if err != nil { return nil, err } - respr, errRespr := r.srv.BeginApplyRecoveryPoint(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) + respr, errRespr := r.srv.BeginApplyRecoveryPoint(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -373,11 +373,11 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginCreate(req *http if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -393,7 +393,7 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginCreate(req *http if err != nil { return nil, err } - respr, errRespr := r.srv.BeginCreate(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) + respr, errRespr := r.srv.BeginCreate(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -433,11 +433,11 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginDelete(req *http if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -453,7 +453,7 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginDelete(req *http if err != nil { return nil, err } - respr, errRespr := r.srv.BeginDelete(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) + respr, errRespr := r.srv.BeginDelete(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -489,11 +489,11 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginFailoverCancel(r if matches == nil || len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -509,7 +509,7 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginFailoverCancel(r if err != nil { return nil, err } - respr, errRespr := r.srv.BeginFailoverCancel(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, nil) + respr, errRespr := r.srv.BeginFailoverCancel(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -545,11 +545,11 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginFailoverCommit(r if matches == nil || len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -565,7 +565,7 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginFailoverCommit(r if err != nil { return nil, err } - respr, errRespr := r.srv.BeginFailoverCommit(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, nil) + respr, errRespr := r.srv.BeginFailoverCommit(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -599,11 +599,11 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchGet(req *http.Request if matches == nil || len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -619,7 +619,7 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchGet(req *http.Request if err != nil { return nil, err } - respr, errRespr := r.srv.Get(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, nil) + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -647,11 +647,11 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchNewListPager(req *htt return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } qp := req.URL.Query() - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -672,7 +672,7 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchNewListPager(req *htt Filter: filterParam, } } - resp := r.srv.NewListPager(resourceNameParam, resourceGroupNameParam, options) + resp := r.srv.NewListPager(resourceGroupNameParam, resourceNameParam, options) newListPager = &resp r.newListPager.add(req, newListPager) server.PagerResponderInjectNextLinks(newListPager, req, func(page *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientListResponse, createLink func() string) { @@ -705,11 +705,11 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchNewListByReplicationP if matches == nil || len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -721,7 +721,7 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchNewListByReplicationP if err != nil { return nil, err } - resp := r.srv.NewListByReplicationProtectionContainersPager(resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, nil) + resp := r.srv.NewListByReplicationProtectionContainersPager(resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, nil) newListByReplicationProtectionContainersPager = &resp r.newListByReplicationProtectionContainersPager.add(req, newListByReplicationProtectionContainersPager) server.PagerResponderInjectNextLinks(newListByReplicationProtectionContainersPager, req, func(page *armrecoveryservicessiterecovery.ReplicationProtectedItemsClientListByReplicationProtectionContainersResponse, createLink func() string) { @@ -758,11 +758,11 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginPlannedFailover( if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -778,7 +778,7 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginPlannedFailover( if err != nil { return nil, err } - respr, errRespr := r.srv.BeginPlannedFailover(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) + respr, errRespr := r.srv.BeginPlannedFailover(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -814,11 +814,11 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginPurge(req *http. if matches == nil || len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -834,7 +834,7 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginPurge(req *http. if err != nil { return nil, err } - respr, errRespr := r.srv.BeginPurge(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, nil) + respr, errRespr := r.srv.BeginPurge(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -874,11 +874,11 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginRemoveDisks(req if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -894,7 +894,7 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginRemoveDisks(req if err != nil { return nil, err } - respr, errRespr := r.srv.BeginRemoveDisks(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) + respr, errRespr := r.srv.BeginRemoveDisks(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -930,11 +930,11 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginRepairReplicatio if matches == nil || len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -950,7 +950,7 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginRepairReplicatio if err != nil { return nil, err } - respr, errRespr := r.srv.BeginRepairReplication(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, nil) + respr, errRespr := r.srv.BeginRepairReplication(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -990,11 +990,11 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginReprotect(req *h if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -1010,7 +1010,7 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginReprotect(req *h if err != nil { return nil, err } - respr, errRespr := r.srv.BeginReprotect(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) + respr, errRespr := r.srv.BeginReprotect(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -1050,11 +1050,11 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginResolveHealthErr if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -1070,7 +1070,7 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginResolveHealthErr if err != nil { return nil, err } - respr, errRespr := r.srv.BeginResolveHealthErrors(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) + respr, errRespr := r.srv.BeginResolveHealthErrors(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -1110,11 +1110,11 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginSwitchProvider(r if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -1130,7 +1130,7 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginSwitchProvider(r if err != nil { return nil, err } - respr, errRespr := r.srv.BeginSwitchProvider(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) + respr, errRespr := r.srv.BeginSwitchProvider(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -1170,11 +1170,11 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginTestFailover(req if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -1190,7 +1190,7 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginTestFailover(req if err != nil { return nil, err } - respr, errRespr := r.srv.BeginTestFailover(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) + respr, errRespr := r.srv.BeginTestFailover(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -1230,11 +1230,11 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginTestFailoverClea if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -1250,7 +1250,7 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginTestFailoverClea if err != nil { return nil, err } - respr, errRespr := r.srv.BeginTestFailoverCleanup(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) + respr, errRespr := r.srv.BeginTestFailoverCleanup(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -1290,11 +1290,11 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginUnplannedFailove if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -1310,7 +1310,7 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginUnplannedFailove if err != nil { return nil, err } - respr, errRespr := r.srv.BeginUnplannedFailover(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) + respr, errRespr := r.srv.BeginUnplannedFailover(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -1350,11 +1350,11 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginUpdate(req *http if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -1370,7 +1370,7 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginUpdate(req *http if err != nil { return nil, err } - respr, errRespr := r.srv.BeginUpdate(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) + respr, errRespr := r.srv.BeginUpdate(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -1410,11 +1410,11 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginUpdateAppliance( if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -1430,7 +1430,7 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginUpdateAppliance( if err != nil { return nil, err } - respr, errRespr := r.srv.BeginUpdateAppliance(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) + respr, errRespr := r.srv.BeginUpdateAppliance(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -1470,11 +1470,11 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginUpdateMobilitySe if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -1490,7 +1490,7 @@ func (r *ReplicationProtectedItemsServerTransport) dispatchBeginUpdateMobilitySe if err != nil { return nil, err } - respr, errRespr := r.srv.BeginUpdateMobilityService(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) + respr, errRespr := r.srv.BeginUpdateMobilityService(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationprotectionclusters_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationprotectionclusters_server.go new file mode 100644 index 000000000000..f43987598fd5 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationprotectionclusters_server.go @@ -0,0 +1,826 @@ +//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 fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/v2" + "net/http" + "net/url" + "regexp" +) + +// ReplicationProtectionClustersServer is a fake server for instances of the armrecoveryservicessiterecovery.ReplicationProtectionClustersClient type. +type ReplicationProtectionClustersServer struct { + // BeginApplyRecoveryPoint is the fake for method ReplicationProtectionClustersClient.BeginApplyRecoveryPoint + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginApplyRecoveryPoint func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, applyClusterRecoveryPointInput armrecoveryservicessiterecovery.ApplyClusterRecoveryPointInput, options *armrecoveryservicessiterecovery.ReplicationProtectionClustersClientBeginApplyRecoveryPointOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientApplyRecoveryPointResponse], errResp azfake.ErrorResponder) + + // BeginCreate is the fake for method ReplicationProtectionClustersClient.BeginCreate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreate func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, replicationProtectionCluster armrecoveryservicessiterecovery.ReplicationProtectionCluster, options *armrecoveryservicessiterecovery.ReplicationProtectionClustersClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientCreateResponse], errResp azfake.ErrorResponder) + + // BeginFailoverCommit is the fake for method ReplicationProtectionClustersClient.BeginFailoverCommit + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginFailoverCommit func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, options *armrecoveryservicessiterecovery.ReplicationProtectionClustersClientBeginFailoverCommitOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientFailoverCommitResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ReplicationProtectionClustersClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, options *armrecoveryservicessiterecovery.ReplicationProtectionClustersClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientGetResponse], errResp azfake.ErrorResponder) + + // GetOperationResults is the fake for method ReplicationProtectionClustersClient.GetOperationResults + // HTTP status codes to indicate success: http.StatusOK + GetOperationResults func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, jobID string, options *armrecoveryservicessiterecovery.ReplicationProtectionClustersClientGetOperationResultsOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientGetOperationResultsResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method ReplicationProtectionClustersClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, resourceName string, options *armrecoveryservicessiterecovery.ReplicationProtectionClustersClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientListResponse]) + + // NewListByReplicationProtectionContainersPager is the fake for method ReplicationProtectionClustersClient.NewListByReplicationProtectionContainersPager + // HTTP status codes to indicate success: http.StatusOK + NewListByReplicationProtectionContainersPager func(resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, options *armrecoveryservicessiterecovery.ReplicationProtectionClustersClientListByReplicationProtectionContainersOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientListByReplicationProtectionContainersResponse]) + + // BeginPurge is the fake for method ReplicationProtectionClustersClient.BeginPurge + // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + BeginPurge func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, options *armrecoveryservicessiterecovery.ReplicationProtectionClustersClientBeginPurgeOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientPurgeResponse], errResp azfake.ErrorResponder) + + // BeginRepairReplication is the fake for method ReplicationProtectionClustersClient.BeginRepairReplication + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginRepairReplication func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, options *armrecoveryservicessiterecovery.ReplicationProtectionClustersClientBeginRepairReplicationOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientRepairReplicationResponse], errResp azfake.ErrorResponder) + + // BeginTestFailover is the fake for method ReplicationProtectionClustersClient.BeginTestFailover + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginTestFailover func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, failoverInput armrecoveryservicessiterecovery.ClusterTestFailoverInput, options *armrecoveryservicessiterecovery.ReplicationProtectionClustersClientBeginTestFailoverOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientTestFailoverResponse], errResp azfake.ErrorResponder) + + // BeginTestFailoverCleanup is the fake for method ReplicationProtectionClustersClient.BeginTestFailoverCleanup + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginTestFailoverCleanup func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, cleanupInput armrecoveryservicessiterecovery.ClusterTestFailoverCleanupInput, options *armrecoveryservicessiterecovery.ReplicationProtectionClustersClientBeginTestFailoverCleanupOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientTestFailoverCleanupResponse], errResp azfake.ErrorResponder) + + // BeginUnplannedFailover is the fake for method ReplicationProtectionClustersClient.BeginUnplannedFailover + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginUnplannedFailover func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, failoverInput armrecoveryservicessiterecovery.ClusterUnplannedFailoverInput, options *armrecoveryservicessiterecovery.ReplicationProtectionClustersClientBeginUnplannedFailoverOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientUnplannedFailoverResponse], errResp azfake.ErrorResponder) +} + +// NewReplicationProtectionClustersServerTransport creates a new instance of ReplicationProtectionClustersServerTransport with the provided implementation. +// The returned ReplicationProtectionClustersServerTransport instance is connected to an instance of armrecoveryservicessiterecovery.ReplicationProtectionClustersClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewReplicationProtectionClustersServerTransport(srv *ReplicationProtectionClustersServer) *ReplicationProtectionClustersServerTransport { + return &ReplicationProtectionClustersServerTransport{ + srv: srv, + beginApplyRecoveryPoint: newTracker[azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientApplyRecoveryPointResponse]](), + beginCreate: newTracker[azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientCreateResponse]](), + beginFailoverCommit: newTracker[azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientFailoverCommitResponse]](), + newListPager: newTracker[azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientListResponse]](), + newListByReplicationProtectionContainersPager: newTracker[azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientListByReplicationProtectionContainersResponse]](), + beginPurge: newTracker[azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientPurgeResponse]](), + beginRepairReplication: newTracker[azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientRepairReplicationResponse]](), + beginTestFailover: newTracker[azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientTestFailoverResponse]](), + beginTestFailoverCleanup: newTracker[azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientTestFailoverCleanupResponse]](), + beginUnplannedFailover: newTracker[azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientUnplannedFailoverResponse]](), + } +} + +// ReplicationProtectionClustersServerTransport connects instances of armrecoveryservicessiterecovery.ReplicationProtectionClustersClient to instances of ReplicationProtectionClustersServer. +// Don't use this type directly, use NewReplicationProtectionClustersServerTransport instead. +type ReplicationProtectionClustersServerTransport struct { + srv *ReplicationProtectionClustersServer + beginApplyRecoveryPoint *tracker[azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientApplyRecoveryPointResponse]] + beginCreate *tracker[azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientCreateResponse]] + beginFailoverCommit *tracker[azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientFailoverCommitResponse]] + newListPager *tracker[azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientListResponse]] + newListByReplicationProtectionContainersPager *tracker[azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientListByReplicationProtectionContainersResponse]] + beginPurge *tracker[azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientPurgeResponse]] + beginRepairReplication *tracker[azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientRepairReplicationResponse]] + beginTestFailover *tracker[azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientTestFailoverResponse]] + beginTestFailoverCleanup *tracker[azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientTestFailoverCleanupResponse]] + beginUnplannedFailover *tracker[azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionClustersClientUnplannedFailoverResponse]] +} + +// Do implements the policy.Transporter interface for ReplicationProtectionClustersServerTransport. +func (r *ReplicationProtectionClustersServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "ReplicationProtectionClustersClient.BeginApplyRecoveryPoint": + resp, err = r.dispatchBeginApplyRecoveryPoint(req) + case "ReplicationProtectionClustersClient.BeginCreate": + resp, err = r.dispatchBeginCreate(req) + case "ReplicationProtectionClustersClient.BeginFailoverCommit": + resp, err = r.dispatchBeginFailoverCommit(req) + case "ReplicationProtectionClustersClient.Get": + resp, err = r.dispatchGet(req) + case "ReplicationProtectionClustersClient.GetOperationResults": + resp, err = r.dispatchGetOperationResults(req) + case "ReplicationProtectionClustersClient.NewListPager": + resp, err = r.dispatchNewListPager(req) + case "ReplicationProtectionClustersClient.NewListByReplicationProtectionContainersPager": + resp, err = r.dispatchNewListByReplicationProtectionContainersPager(req) + case "ReplicationProtectionClustersClient.BeginPurge": + resp, err = r.dispatchBeginPurge(req) + case "ReplicationProtectionClustersClient.BeginRepairReplication": + resp, err = r.dispatchBeginRepairReplication(req) + case "ReplicationProtectionClustersClient.BeginTestFailover": + resp, err = r.dispatchBeginTestFailover(req) + case "ReplicationProtectionClustersClient.BeginTestFailoverCleanup": + resp, err = r.dispatchBeginTestFailoverCleanup(req) + case "ReplicationProtectionClustersClient.BeginUnplannedFailover": + resp, err = r.dispatchBeginUnplannedFailover(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (r *ReplicationProtectionClustersServerTransport) dispatchBeginApplyRecoveryPoint(req *http.Request) (*http.Response, error) { + if r.srv.BeginApplyRecoveryPoint == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginApplyRecoveryPoint not implemented")} + } + beginApplyRecoveryPoint := r.beginApplyRecoveryPoint.get(req) + if beginApplyRecoveryPoint == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.RecoveryServices/vaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationFabrics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionContainers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applyRecoveryPoint` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 6 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armrecoveryservicessiterecovery.ApplyClusterRecoveryPointInput](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + fabricNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fabricName")]) + if err != nil { + return nil, err + } + protectionContainerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("protectionContainerName")]) + if err != nil { + return nil, err + } + replicationProtectionClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("replicationProtectionClusterName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginApplyRecoveryPoint(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicationProtectionClusterNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginApplyRecoveryPoint = &respr + r.beginApplyRecoveryPoint.add(req, beginApplyRecoveryPoint) + } + + resp, err := server.PollerResponderNext(beginApplyRecoveryPoint, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + r.beginApplyRecoveryPoint.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginApplyRecoveryPoint) { + r.beginApplyRecoveryPoint.remove(req) + } + + return resp, nil +} + +func (r *ReplicationProtectionClustersServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { + if r.srv.BeginCreate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreate not implemented")} + } + beginCreate := r.beginCreate.get(req) + if beginCreate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.RecoveryServices/vaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationFabrics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionContainers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 6 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armrecoveryservicessiterecovery.ReplicationProtectionCluster](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + fabricNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fabricName")]) + if err != nil { + return nil, err + } + protectionContainerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("protectionContainerName")]) + if err != nil { + return nil, err + } + replicationProtectionClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("replicationProtectionClusterName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginCreate(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicationProtectionClusterNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreate = &respr + r.beginCreate.add(req, beginCreate) + } + + resp, err := server.PollerResponderNext(beginCreate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + r.beginCreate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreate) { + r.beginCreate.remove(req) + } + + return resp, nil +} + +func (r *ReplicationProtectionClustersServerTransport) dispatchBeginFailoverCommit(req *http.Request) (*http.Response, error) { + if r.srv.BeginFailoverCommit == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginFailoverCommit not implemented")} + } + beginFailoverCommit := r.beginFailoverCommit.get(req) + if beginFailoverCommit == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.RecoveryServices/vaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationFabrics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionContainers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/failoverCommit` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 6 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + fabricNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fabricName")]) + if err != nil { + return nil, err + } + protectionContainerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("protectionContainerName")]) + if err != nil { + return nil, err + } + replicationProtectionClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("replicationProtectionClusterName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginFailoverCommit(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicationProtectionClusterNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginFailoverCommit = &respr + r.beginFailoverCommit.add(req, beginFailoverCommit) + } + + resp, err := server.PollerResponderNext(beginFailoverCommit, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + r.beginFailoverCommit.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginFailoverCommit) { + r.beginFailoverCommit.remove(req) + } + + return resp, nil +} + +func (r *ReplicationProtectionClustersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if r.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.RecoveryServices/vaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationFabrics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionContainers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 6 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + fabricNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fabricName")]) + if err != nil { + return nil, err + } + protectionContainerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("protectionContainerName")]) + if err != nil { + return nil, err + } + replicationProtectionClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("replicationProtectionClusterName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicationProtectionClusterNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ReplicationProtectionCluster, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (r *ReplicationProtectionClustersServerTransport) dispatchGetOperationResults(req *http.Request) (*http.Response, error) { + if r.srv.GetOperationResults == nil { + return nil, &nonRetriableError{errors.New("fake for method GetOperationResults not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.RecoveryServices/vaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationFabrics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionContainers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/operationResults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 7 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + fabricNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fabricName")]) + if err != nil { + return nil, err + } + protectionContainerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("protectionContainerName")]) + if err != nil { + return nil, err + } + replicationProtectionClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("replicationProtectionClusterName")]) + if err != nil { + return nil, err + } + jobIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("jobId")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.GetOperationResults(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicationProtectionClusterNameParam, jobIDParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ReplicationProtectionCluster, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (r *ReplicationProtectionClustersServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if r.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := r.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.RecoveryServices/vaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionClusters` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + skipTokenUnescaped, err := url.QueryUnescape(qp.Get("skipToken")) + if err != nil { + return nil, err + } + skipTokenParam := getOptional(skipTokenUnescaped) + filterUnescaped, err := url.QueryUnescape(qp.Get("$filter")) + if err != nil { + return nil, err + } + filterParam := getOptional(filterUnescaped) + var options *armrecoveryservicessiterecovery.ReplicationProtectionClustersClientListOptions + if skipTokenParam != nil || filterParam != nil { + options = &armrecoveryservicessiterecovery.ReplicationProtectionClustersClientListOptions{ + SkipToken: skipTokenParam, + Filter: filterParam, + } + } + resp := r.srv.NewListPager(resourceGroupNameParam, resourceNameParam, options) + newListPager = &resp + r.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armrecoveryservicessiterecovery.ReplicationProtectionClustersClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + r.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + r.newListPager.remove(req) + } + return resp, nil +} + +func (r *ReplicationProtectionClustersServerTransport) dispatchNewListByReplicationProtectionContainersPager(req *http.Request) (*http.Response, error) { + if r.srv.NewListByReplicationProtectionContainersPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByReplicationProtectionContainersPager not implemented")} + } + newListByReplicationProtectionContainersPager := r.newListByReplicationProtectionContainersPager.get(req) + if newListByReplicationProtectionContainersPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.RecoveryServices/vaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationFabrics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionContainers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionClusters` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + fabricNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fabricName")]) + if err != nil { + return nil, err + } + protectionContainerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("protectionContainerName")]) + if err != nil { + return nil, err + } + resp := r.srv.NewListByReplicationProtectionContainersPager(resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, nil) + newListByReplicationProtectionContainersPager = &resp + r.newListByReplicationProtectionContainersPager.add(req, newListByReplicationProtectionContainersPager) + server.PagerResponderInjectNextLinks(newListByReplicationProtectionContainersPager, req, func(page *armrecoveryservicessiterecovery.ReplicationProtectionClustersClientListByReplicationProtectionContainersResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByReplicationProtectionContainersPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + r.newListByReplicationProtectionContainersPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByReplicationProtectionContainersPager) { + r.newListByReplicationProtectionContainersPager.remove(req) + } + return resp, nil +} + +func (r *ReplicationProtectionClustersServerTransport) dispatchBeginPurge(req *http.Request) (*http.Response, error) { + if r.srv.BeginPurge == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginPurge not implemented")} + } + beginPurge := r.beginPurge.get(req) + if beginPurge == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.RecoveryServices/vaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationFabrics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionContainers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 6 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + fabricNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fabricName")]) + if err != nil { + return nil, err + } + protectionContainerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("protectionContainerName")]) + if err != nil { + return nil, err + } + replicationProtectionClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("replicationProtectionClusterName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginPurge(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicationProtectionClusterNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginPurge = &respr + r.beginPurge.add(req, beginPurge) + } + + resp, err := server.PollerResponderNext(beginPurge, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + r.beginPurge.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginPurge) { + r.beginPurge.remove(req) + } + + return resp, nil +} + +func (r *ReplicationProtectionClustersServerTransport) dispatchBeginRepairReplication(req *http.Request) (*http.Response, error) { + if r.srv.BeginRepairReplication == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginRepairReplication not implemented")} + } + beginRepairReplication := r.beginRepairReplication.get(req) + if beginRepairReplication == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.RecoveryServices/vaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationFabrics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionContainers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/repairReplication` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 6 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + fabricNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fabricName")]) + if err != nil { + return nil, err + } + protectionContainerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("protectionContainerName")]) + if err != nil { + return nil, err + } + replicationProtectionClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("replicationProtectionClusterName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginRepairReplication(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicationProtectionClusterNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginRepairReplication = &respr + r.beginRepairReplication.add(req, beginRepairReplication) + } + + resp, err := server.PollerResponderNext(beginRepairReplication, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + r.beginRepairReplication.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginRepairReplication) { + r.beginRepairReplication.remove(req) + } + + return resp, nil +} + +func (r *ReplicationProtectionClustersServerTransport) dispatchBeginTestFailover(req *http.Request) (*http.Response, error) { + if r.srv.BeginTestFailover == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginTestFailover not implemented")} + } + beginTestFailover := r.beginTestFailover.get(req) + if beginTestFailover == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.RecoveryServices/vaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationFabrics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionContainers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/testFailover` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 6 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armrecoveryservicessiterecovery.ClusterTestFailoverInput](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + fabricNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fabricName")]) + if err != nil { + return nil, err + } + protectionContainerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("protectionContainerName")]) + if err != nil { + return nil, err + } + replicationProtectionClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("replicationProtectionClusterName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginTestFailover(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicationProtectionClusterNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginTestFailover = &respr + r.beginTestFailover.add(req, beginTestFailover) + } + + resp, err := server.PollerResponderNext(beginTestFailover, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + r.beginTestFailover.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginTestFailover) { + r.beginTestFailover.remove(req) + } + + return resp, nil +} + +func (r *ReplicationProtectionClustersServerTransport) dispatchBeginTestFailoverCleanup(req *http.Request) (*http.Response, error) { + if r.srv.BeginTestFailoverCleanup == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginTestFailoverCleanup not implemented")} + } + beginTestFailoverCleanup := r.beginTestFailoverCleanup.get(req) + if beginTestFailoverCleanup == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.RecoveryServices/vaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationFabrics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionContainers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/testFailoverCleanup` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 6 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armrecoveryservicessiterecovery.ClusterTestFailoverCleanupInput](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + fabricNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fabricName")]) + if err != nil { + return nil, err + } + protectionContainerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("protectionContainerName")]) + if err != nil { + return nil, err + } + replicationProtectionClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("replicationProtectionClusterName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginTestFailoverCleanup(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicationProtectionClusterNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginTestFailoverCleanup = &respr + r.beginTestFailoverCleanup.add(req, beginTestFailoverCleanup) + } + + resp, err := server.PollerResponderNext(beginTestFailoverCleanup, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + r.beginTestFailoverCleanup.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginTestFailoverCleanup) { + r.beginTestFailoverCleanup.remove(req) + } + + return resp, nil +} + +func (r *ReplicationProtectionClustersServerTransport) dispatchBeginUnplannedFailover(req *http.Request) (*http.Response, error) { + if r.srv.BeginUnplannedFailover == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUnplannedFailover not implemented")} + } + beginUnplannedFailover := r.beginUnplannedFailover.get(req) + if beginUnplannedFailover == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.RecoveryServices/vaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationFabrics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionContainers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/unplannedFailover` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 6 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armrecoveryservicessiterecovery.ClusterUnplannedFailoverInput](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + fabricNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fabricName")]) + if err != nil { + return nil, err + } + protectionContainerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("protectionContainerName")]) + if err != nil { + return nil, err + } + replicationProtectionClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("replicationProtectionClusterName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginUnplannedFailover(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicationProtectionClusterNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUnplannedFailover = &respr + r.beginUnplannedFailover.add(req, beginUnplannedFailover) + } + + resp, err := server.PollerResponderNext(beginUnplannedFailover, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + r.beginUnplannedFailover.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUnplannedFailover) { + r.beginUnplannedFailover.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationprotectioncontainermappings_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationprotectioncontainermappings_server.go index c6cf73fa839a..81b2edd28116 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationprotectioncontainermappings_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationprotectioncontainermappings_server.go @@ -26,31 +26,31 @@ import ( type ReplicationProtectionContainerMappingsServer struct { // BeginCreate is the fake for method ReplicationProtectionContainerMappingsClient.BeginCreate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginCreate func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, mappingName string, creationInput armrecoveryservicessiterecovery.CreateProtectionContainerMappingInput, options *armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientCreateResponse], errResp azfake.ErrorResponder) + BeginCreate func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, mappingName string, creationInput armrecoveryservicessiterecovery.CreateProtectionContainerMappingInput, options *armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientCreateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method ReplicationProtectionContainerMappingsClient.BeginDelete // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, mappingName string, removalInput armrecoveryservicessiterecovery.RemoveProtectionContainerMappingInput, options *armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientBeginDeleteOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientDeleteResponse], errResp azfake.ErrorResponder) + BeginDelete func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, mappingName string, removalInput armrecoveryservicessiterecovery.RemoveProtectionContainerMappingInput, options *armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientBeginDeleteOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method ReplicationProtectionContainerMappingsClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, mappingName string, options *armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, mappingName string, options *armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientGetResponse], errResp azfake.ErrorResponder) // NewListPager is the fake for method ReplicationProtectionContainerMappingsClient.NewListPager // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceName string, resourceGroupName string, options *armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientListResponse]) + NewListPager func(resourceGroupName string, resourceName string, options *armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientListResponse]) // NewListByReplicationProtectionContainersPager is the fake for method ReplicationProtectionContainerMappingsClient.NewListByReplicationProtectionContainersPager // HTTP status codes to indicate success: http.StatusOK - NewListByReplicationProtectionContainersPager func(resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, options *armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientListByReplicationProtectionContainersOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientListByReplicationProtectionContainersResponse]) + NewListByReplicationProtectionContainersPager func(resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, options *armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientListByReplicationProtectionContainersOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientListByReplicationProtectionContainersResponse]) // BeginPurge is the fake for method ReplicationProtectionContainerMappingsClient.BeginPurge // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginPurge func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, mappingName string, options *armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientBeginPurgeOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientPurgeResponse], errResp azfake.ErrorResponder) + BeginPurge func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, mappingName string, options *armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientBeginPurgeOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientPurgeResponse], errResp azfake.ErrorResponder) // BeginUpdate is the fake for method ReplicationProtectionContainerMappingsClient.BeginUpdate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdate func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, mappingName string, updateInput armrecoveryservicessiterecovery.UpdateProtectionContainerMappingInput, options *armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientBeginUpdateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientUpdateResponse], errResp azfake.ErrorResponder) + BeginUpdate func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, mappingName string, updateInput armrecoveryservicessiterecovery.UpdateProtectionContainerMappingInput, options *armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientBeginUpdateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientUpdateResponse], errResp azfake.ErrorResponder) } // NewReplicationProtectionContainerMappingsServerTransport creates a new instance of ReplicationProtectionContainerMappingsServerTransport with the provided implementation. @@ -133,11 +133,11 @@ func (r *ReplicationProtectionContainerMappingsServerTransport) dispatchBeginCre if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -153,7 +153,7 @@ func (r *ReplicationProtectionContainerMappingsServerTransport) dispatchBeginCre if err != nil { return nil, err } - respr, errRespr := r.srv.BeginCreate(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, mappingNameParam, body, nil) + respr, errRespr := r.srv.BeginCreate(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, mappingNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -193,11 +193,11 @@ func (r *ReplicationProtectionContainerMappingsServerTransport) dispatchBeginDel if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -213,7 +213,7 @@ func (r *ReplicationProtectionContainerMappingsServerTransport) dispatchBeginDel if err != nil { return nil, err } - respr, errRespr := r.srv.BeginDelete(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, mappingNameParam, body, nil) + respr, errRespr := r.srv.BeginDelete(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, mappingNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -247,11 +247,11 @@ func (r *ReplicationProtectionContainerMappingsServerTransport) dispatchGet(req if matches == nil || len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -267,7 +267,7 @@ func (r *ReplicationProtectionContainerMappingsServerTransport) dispatchGet(req if err != nil { return nil, err } - respr, errRespr := r.srv.Get(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, mappingNameParam, nil) + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, mappingNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -294,15 +294,15 @@ func (r *ReplicationProtectionContainerMappingsServerTransport) dispatchNewListP if matches == nil || len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } - resp := r.srv.NewListPager(resourceNameParam, resourceGroupNameParam, nil) + resp := r.srv.NewListPager(resourceGroupNameParam, resourceNameParam, nil) newListPager = &resp r.newListPager.add(req, newListPager) server.PagerResponderInjectNextLinks(newListPager, req, func(page *armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientListResponse, createLink func() string) { @@ -335,11 +335,11 @@ func (r *ReplicationProtectionContainerMappingsServerTransport) dispatchNewListB if matches == nil || len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -351,7 +351,7 @@ func (r *ReplicationProtectionContainerMappingsServerTransport) dispatchNewListB if err != nil { return nil, err } - resp := r.srv.NewListByReplicationProtectionContainersPager(resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, nil) + resp := r.srv.NewListByReplicationProtectionContainersPager(resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, nil) newListByReplicationProtectionContainersPager = &resp r.newListByReplicationProtectionContainersPager.add(req, newListByReplicationProtectionContainersPager) server.PagerResponderInjectNextLinks(newListByReplicationProtectionContainersPager, req, func(page *armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientListByReplicationProtectionContainersResponse, createLink func() string) { @@ -384,11 +384,11 @@ func (r *ReplicationProtectionContainerMappingsServerTransport) dispatchBeginPur if matches == nil || len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -404,7 +404,7 @@ func (r *ReplicationProtectionContainerMappingsServerTransport) dispatchBeginPur if err != nil { return nil, err } - respr, errRespr := r.srv.BeginPurge(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, mappingNameParam, nil) + respr, errRespr := r.srv.BeginPurge(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, mappingNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -444,11 +444,11 @@ func (r *ReplicationProtectionContainerMappingsServerTransport) dispatchBeginUpd if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -464,7 +464,7 @@ func (r *ReplicationProtectionContainerMappingsServerTransport) dispatchBeginUpd if err != nil { return nil, err } - respr, errRespr := r.srv.BeginUpdate(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, mappingNameParam, body, nil) + respr, errRespr := r.srv.BeginUpdate(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, mappingNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationprotectioncontainers_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationprotectioncontainers_server.go index 2c1119946750..2b2dd0b57272 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationprotectioncontainers_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationprotectioncontainers_server.go @@ -26,31 +26,35 @@ import ( type ReplicationProtectionContainersServer struct { // BeginCreate is the fake for method ReplicationProtectionContainersClient.BeginCreate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginCreate func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, creationInput armrecoveryservicessiterecovery.CreateProtectionContainerInput, options *armrecoveryservicessiterecovery.ReplicationProtectionContainersClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainersClientCreateResponse], errResp azfake.ErrorResponder) + BeginCreate func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, creationInput armrecoveryservicessiterecovery.CreateProtectionContainerInput, options *armrecoveryservicessiterecovery.ReplicationProtectionContainersClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainersClientCreateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method ReplicationProtectionContainersClient.BeginDelete // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, options *armrecoveryservicessiterecovery.ReplicationProtectionContainersClientBeginDeleteOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainersClientDeleteResponse], errResp azfake.ErrorResponder) + BeginDelete func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, options *armrecoveryservicessiterecovery.ReplicationProtectionContainersClientBeginDeleteOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainersClientDeleteResponse], errResp azfake.ErrorResponder) // BeginDiscoverProtectableItem is the fake for method ReplicationProtectionContainersClient.BeginDiscoverProtectableItem // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginDiscoverProtectableItem func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, discoverProtectableItemRequest armrecoveryservicessiterecovery.DiscoverProtectableItemRequest, options *armrecoveryservicessiterecovery.ReplicationProtectionContainersClientBeginDiscoverProtectableItemOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainersClientDiscoverProtectableItemResponse], errResp azfake.ErrorResponder) + BeginDiscoverProtectableItem func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, discoverProtectableItemRequest armrecoveryservicessiterecovery.DiscoverProtectableItemRequest, options *armrecoveryservicessiterecovery.ReplicationProtectionContainersClientBeginDiscoverProtectableItemOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainersClientDiscoverProtectableItemResponse], errResp azfake.ErrorResponder) // Get is the fake for method ReplicationProtectionContainersClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, options *armrecoveryservicessiterecovery.ReplicationProtectionContainersClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationProtectionContainersClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, options *armrecoveryservicessiterecovery.ReplicationProtectionContainersClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationProtectionContainersClientGetResponse], errResp azfake.ErrorResponder) // NewListPager is the fake for method ReplicationProtectionContainersClient.NewListPager // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceName string, resourceGroupName string, options *armrecoveryservicessiterecovery.ReplicationProtectionContainersClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainersClientListResponse]) + NewListPager func(resourceGroupName string, resourceName string, options *armrecoveryservicessiterecovery.ReplicationProtectionContainersClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainersClientListResponse]) // NewListByReplicationFabricsPager is the fake for method ReplicationProtectionContainersClient.NewListByReplicationFabricsPager // HTTP status codes to indicate success: http.StatusOK - NewListByReplicationFabricsPager func(resourceName string, resourceGroupName string, fabricName string, options *armrecoveryservicessiterecovery.ReplicationProtectionContainersClientListByReplicationFabricsOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainersClientListByReplicationFabricsResponse]) + NewListByReplicationFabricsPager func(resourceGroupName string, resourceName string, fabricName string, options *armrecoveryservicessiterecovery.ReplicationProtectionContainersClientListByReplicationFabricsOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainersClientListByReplicationFabricsResponse]) + + // BeginSwitchClusterProtection is the fake for method ReplicationProtectionContainersClient.BeginSwitchClusterProtection + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginSwitchClusterProtection func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, switchInput armrecoveryservicessiterecovery.SwitchClusterProtectionInput, options *armrecoveryservicessiterecovery.ReplicationProtectionContainersClientBeginSwitchClusterProtectionOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainersClientSwitchClusterProtectionResponse], errResp azfake.ErrorResponder) // BeginSwitchProtection is the fake for method ReplicationProtectionContainersClient.BeginSwitchProtection // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginSwitchProtection func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, switchInput armrecoveryservicessiterecovery.SwitchProtectionInput, options *armrecoveryservicessiterecovery.ReplicationProtectionContainersClientBeginSwitchProtectionOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainersClientSwitchProtectionResponse], errResp azfake.ErrorResponder) + BeginSwitchProtection func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, switchInput armrecoveryservicessiterecovery.SwitchProtectionInput, options *armrecoveryservicessiterecovery.ReplicationProtectionContainersClientBeginSwitchProtectionOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainersClientSwitchProtectionResponse], errResp azfake.ErrorResponder) } // NewReplicationProtectionContainersServerTransport creates a new instance of ReplicationProtectionContainersServerTransport with the provided implementation. @@ -64,6 +68,7 @@ func NewReplicationProtectionContainersServerTransport(srv *ReplicationProtectio beginDiscoverProtectableItem: newTracker[azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainersClientDiscoverProtectableItemResponse]](), newListPager: newTracker[azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainersClientListResponse]](), newListByReplicationFabricsPager: newTracker[azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainersClientListByReplicationFabricsResponse]](), + beginSwitchClusterProtection: newTracker[azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainersClientSwitchClusterProtectionResponse]](), beginSwitchProtection: newTracker[azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainersClientSwitchProtectionResponse]](), } } @@ -77,6 +82,7 @@ type ReplicationProtectionContainersServerTransport struct { beginDiscoverProtectableItem *tracker[azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainersClientDiscoverProtectableItemResponse]] newListPager *tracker[azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainersClientListResponse]] newListByReplicationFabricsPager *tracker[azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainersClientListByReplicationFabricsResponse]] + beginSwitchClusterProtection *tracker[azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainersClientSwitchClusterProtectionResponse]] beginSwitchProtection *tracker[azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationProtectionContainersClientSwitchProtectionResponse]] } @@ -104,6 +110,8 @@ func (r *ReplicationProtectionContainersServerTransport) Do(req *http.Request) ( resp, err = r.dispatchNewListPager(req) case "ReplicationProtectionContainersClient.NewListByReplicationFabricsPager": resp, err = r.dispatchNewListByReplicationFabricsPager(req) + case "ReplicationProtectionContainersClient.BeginSwitchClusterProtection": + resp, err = r.dispatchBeginSwitchClusterProtection(req) case "ReplicationProtectionContainersClient.BeginSwitchProtection": resp, err = r.dispatchBeginSwitchProtection(req) default: @@ -133,11 +141,11 @@ func (r *ReplicationProtectionContainersServerTransport) dispatchBeginCreate(req if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -149,7 +157,7 @@ func (r *ReplicationProtectionContainersServerTransport) dispatchBeginCreate(req if err != nil { return nil, err } - respr, errRespr := r.srv.BeginCreate(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, body, nil) + respr, errRespr := r.srv.BeginCreate(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -185,11 +193,11 @@ func (r *ReplicationProtectionContainersServerTransport) dispatchBeginDelete(req if matches == nil || len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -201,7 +209,7 @@ func (r *ReplicationProtectionContainersServerTransport) dispatchBeginDelete(req if err != nil { return nil, err } - respr, errRespr := r.srv.BeginDelete(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, nil) + respr, errRespr := r.srv.BeginDelete(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -241,11 +249,11 @@ func (r *ReplicationProtectionContainersServerTransport) dispatchBeginDiscoverPr if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -257,7 +265,7 @@ func (r *ReplicationProtectionContainersServerTransport) dispatchBeginDiscoverPr if err != nil { return nil, err } - respr, errRespr := r.srv.BeginDiscoverProtectableItem(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, body, nil) + respr, errRespr := r.srv.BeginDiscoverProtectableItem(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -291,11 +299,11 @@ func (r *ReplicationProtectionContainersServerTransport) dispatchGet(req *http.R if matches == nil || len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -307,7 +315,7 @@ func (r *ReplicationProtectionContainersServerTransport) dispatchGet(req *http.R if err != nil { return nil, err } - respr, errRespr := r.srv.Get(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, nil) + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -334,15 +342,15 @@ func (r *ReplicationProtectionContainersServerTransport) dispatchNewListPager(re if matches == nil || len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } - resp := r.srv.NewListPager(resourceNameParam, resourceGroupNameParam, nil) + resp := r.srv.NewListPager(resourceGroupNameParam, resourceNameParam, nil) newListPager = &resp r.newListPager.add(req, newListPager) server.PagerResponderInjectNextLinks(newListPager, req, func(page *armrecoveryservicessiterecovery.ReplicationProtectionContainersClientListResponse, createLink func() string) { @@ -375,11 +383,11 @@ func (r *ReplicationProtectionContainersServerTransport) dispatchNewListByReplic if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -387,7 +395,7 @@ func (r *ReplicationProtectionContainersServerTransport) dispatchNewListByReplic if err != nil { return nil, err } - resp := r.srv.NewListByReplicationFabricsPager(resourceNameParam, resourceGroupNameParam, fabricNameParam, nil) + resp := r.srv.NewListByReplicationFabricsPager(resourceGroupNameParam, resourceNameParam, fabricNameParam, nil) newListByReplicationFabricsPager = &resp r.newListByReplicationFabricsPager.add(req, newListByReplicationFabricsPager) server.PagerResponderInjectNextLinks(newListByReplicationFabricsPager, req, func(page *armrecoveryservicessiterecovery.ReplicationProtectionContainersClientListByReplicationFabricsResponse, createLink func() string) { @@ -408,6 +416,62 @@ func (r *ReplicationProtectionContainersServerTransport) dispatchNewListByReplic return resp, nil } +func (r *ReplicationProtectionContainersServerTransport) dispatchBeginSwitchClusterProtection(req *http.Request) (*http.Response, error) { + if r.srv.BeginSwitchClusterProtection == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginSwitchClusterProtection not implemented")} + } + beginSwitchClusterProtection := r.beginSwitchClusterProtection.get(req) + if beginSwitchClusterProtection == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.RecoveryServices/vaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationFabrics/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/replicationProtectionContainers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/switchClusterProtection` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armrecoveryservicessiterecovery.SwitchClusterProtectionInput](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + fabricNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fabricName")]) + if err != nil { + return nil, err + } + protectionContainerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("protectionContainerName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginSwitchClusterProtection(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginSwitchClusterProtection = &respr + r.beginSwitchClusterProtection.add(req, beginSwitchClusterProtection) + } + + resp, err := server.PollerResponderNext(beginSwitchClusterProtection, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + r.beginSwitchClusterProtection.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginSwitchClusterProtection) { + r.beginSwitchClusterProtection.remove(req) + } + + return resp, nil +} + func (r *ReplicationProtectionContainersServerTransport) dispatchBeginSwitchProtection(req *http.Request) (*http.Response, error) { if r.srv.BeginSwitchProtection == nil { return nil, &nonRetriableError{errors.New("fake for method BeginSwitchProtection not implemented")} @@ -424,11 +488,11 @@ func (r *ReplicationProtectionContainersServerTransport) dispatchBeginSwitchProt if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -440,7 +504,7 @@ func (r *ReplicationProtectionContainersServerTransport) dispatchBeginSwitchProt if err != nil { return nil, err } - respr, errRespr := r.srv.BeginSwitchProtection(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, body, nil) + respr, errRespr := r.srv.BeginSwitchProtection(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationprotectionintents_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationprotectionintents_server.go index f9f4c556f7ac..e6ca10c9e685 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationprotectionintents_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationprotectionintents_server.go @@ -26,15 +26,15 @@ import ( type ReplicationProtectionIntentsServer struct { // Create is the fake for method ReplicationProtectionIntentsClient.Create // HTTP status codes to indicate success: http.StatusOK - Create func(ctx context.Context, resourceName string, resourceGroupName string, intentObjectName string, input armrecoveryservicessiterecovery.CreateProtectionIntentInput, options *armrecoveryservicessiterecovery.ReplicationProtectionIntentsClientCreateOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationProtectionIntentsClientCreateResponse], errResp azfake.ErrorResponder) + Create func(ctx context.Context, resourceGroupName string, resourceName string, intentObjectName string, input armrecoveryservicessiterecovery.CreateProtectionIntentInput, options *armrecoveryservicessiterecovery.ReplicationProtectionIntentsClientCreateOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationProtectionIntentsClientCreateResponse], errResp azfake.ErrorResponder) // Get is the fake for method ReplicationProtectionIntentsClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceName string, resourceGroupName string, intentObjectName string, options *armrecoveryservicessiterecovery.ReplicationProtectionIntentsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationProtectionIntentsClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, resourceName string, intentObjectName string, options *armrecoveryservicessiterecovery.ReplicationProtectionIntentsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationProtectionIntentsClientGetResponse], errResp azfake.ErrorResponder) // NewListPager is the fake for method ReplicationProtectionIntentsClient.NewListPager // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceName string, resourceGroupName string, options *armrecoveryservicessiterecovery.ReplicationProtectionIntentsClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectionIntentsClientListResponse]) + NewListPager func(resourceGroupName string, resourceName string, options *armrecoveryservicessiterecovery.ReplicationProtectionIntentsClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationProtectionIntentsClientListResponse]) } // NewReplicationProtectionIntentsServerTransport creates a new instance of ReplicationProtectionIntentsServerTransport with the provided implementation. @@ -97,11 +97,11 @@ func (r *ReplicationProtectionIntentsServerTransport) dispatchCreate(req *http.R if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -109,7 +109,7 @@ func (r *ReplicationProtectionIntentsServerTransport) dispatchCreate(req *http.R if err != nil { return nil, err } - respr, errRespr := r.srv.Create(req.Context(), resourceNameParam, resourceGroupNameParam, intentObjectNameParam, body, nil) + respr, errRespr := r.srv.Create(req.Context(), resourceGroupNameParam, resourceNameParam, intentObjectNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -134,11 +134,11 @@ func (r *ReplicationProtectionIntentsServerTransport) dispatchGet(req *http.Requ if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -146,7 +146,7 @@ func (r *ReplicationProtectionIntentsServerTransport) dispatchGet(req *http.Requ if err != nil { return nil, err } - respr, errRespr := r.srv.Get(req.Context(), resourceNameParam, resourceGroupNameParam, intentObjectNameParam, nil) + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, intentObjectNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -174,11 +174,11 @@ func (r *ReplicationProtectionIntentsServerTransport) dispatchNewListPager(req * return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } qp := req.URL.Query() - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -199,7 +199,7 @@ func (r *ReplicationProtectionIntentsServerTransport) dispatchNewListPager(req * TakeToken: takeTokenParam, } } - resp := r.srv.NewListPager(resourceNameParam, resourceGroupNameParam, options) + resp := r.srv.NewListPager(resourceGroupNameParam, resourceNameParam, options) newListPager = &resp r.newListPager.add(req, newListPager) server.PagerResponderInjectNextLinks(newListPager, req, func(page *armrecoveryservicessiterecovery.ReplicationProtectionIntentsClientListResponse, createLink func() string) { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationrecoveryplans_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationrecoveryplans_server.go index 24d189ffe0b4..378414bc72e3 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationrecoveryplans_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationrecoveryplans_server.go @@ -26,51 +26,51 @@ import ( type ReplicationRecoveryPlansServer struct { // BeginCreate is the fake for method ReplicationRecoveryPlansClient.BeginCreate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginCreate func(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input armrecoveryservicessiterecovery.CreateRecoveryPlanInput, options *armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientCreateResponse], errResp azfake.ErrorResponder) + BeginCreate func(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, input armrecoveryservicessiterecovery.CreateRecoveryPlanInput, options *armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientCreateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method ReplicationRecoveryPlansClient.BeginDelete // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, options *armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientBeginDeleteOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientDeleteResponse], errResp azfake.ErrorResponder) + BeginDelete func(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, options *armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientBeginDeleteOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientDeleteResponse], errResp azfake.ErrorResponder) // BeginFailoverCancel is the fake for method ReplicationRecoveryPlansClient.BeginFailoverCancel // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginFailoverCancel func(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, options *armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientBeginFailoverCancelOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientFailoverCancelResponse], errResp azfake.ErrorResponder) + BeginFailoverCancel func(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, options *armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientBeginFailoverCancelOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientFailoverCancelResponse], errResp azfake.ErrorResponder) // BeginFailoverCommit is the fake for method ReplicationRecoveryPlansClient.BeginFailoverCommit // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginFailoverCommit func(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, options *armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientBeginFailoverCommitOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientFailoverCommitResponse], errResp azfake.ErrorResponder) + BeginFailoverCommit func(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, options *armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientBeginFailoverCommitOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientFailoverCommitResponse], errResp azfake.ErrorResponder) // Get is the fake for method ReplicationRecoveryPlansClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, options *armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, options *armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientGetResponse], errResp azfake.ErrorResponder) // NewListPager is the fake for method ReplicationRecoveryPlansClient.NewListPager // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceName string, resourceGroupName string, options *armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientListResponse]) + NewListPager func(resourceGroupName string, resourceName string, options *armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientListResponse]) // BeginPlannedFailover is the fake for method ReplicationRecoveryPlansClient.BeginPlannedFailover // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginPlannedFailover func(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input armrecoveryservicessiterecovery.RecoveryPlanPlannedFailoverInput, options *armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientBeginPlannedFailoverOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientPlannedFailoverResponse], errResp azfake.ErrorResponder) + BeginPlannedFailover func(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, input armrecoveryservicessiterecovery.RecoveryPlanPlannedFailoverInput, options *armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientBeginPlannedFailoverOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientPlannedFailoverResponse], errResp azfake.ErrorResponder) // BeginReprotect is the fake for method ReplicationRecoveryPlansClient.BeginReprotect // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginReprotect func(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, options *armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientBeginReprotectOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientReprotectResponse], errResp azfake.ErrorResponder) + BeginReprotect func(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, options *armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientBeginReprotectOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientReprotectResponse], errResp azfake.ErrorResponder) // BeginTestFailover is the fake for method ReplicationRecoveryPlansClient.BeginTestFailover // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginTestFailover func(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input armrecoveryservicessiterecovery.RecoveryPlanTestFailoverInput, options *armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientBeginTestFailoverOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientTestFailoverResponse], errResp azfake.ErrorResponder) + BeginTestFailover func(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, input armrecoveryservicessiterecovery.RecoveryPlanTestFailoverInput, options *armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientBeginTestFailoverOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientTestFailoverResponse], errResp azfake.ErrorResponder) // BeginTestFailoverCleanup is the fake for method ReplicationRecoveryPlansClient.BeginTestFailoverCleanup // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginTestFailoverCleanup func(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input armrecoveryservicessiterecovery.RecoveryPlanTestFailoverCleanupInput, options *armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientBeginTestFailoverCleanupOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientTestFailoverCleanupResponse], errResp azfake.ErrorResponder) + BeginTestFailoverCleanup func(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, input armrecoveryservicessiterecovery.RecoveryPlanTestFailoverCleanupInput, options *armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientBeginTestFailoverCleanupOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientTestFailoverCleanupResponse], errResp azfake.ErrorResponder) // BeginUnplannedFailover is the fake for method ReplicationRecoveryPlansClient.BeginUnplannedFailover // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUnplannedFailover func(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input armrecoveryservicessiterecovery.RecoveryPlanUnplannedFailoverInput, options *armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientBeginUnplannedFailoverOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientUnplannedFailoverResponse], errResp azfake.ErrorResponder) + BeginUnplannedFailover func(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, input armrecoveryservicessiterecovery.RecoveryPlanUnplannedFailoverInput, options *armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientBeginUnplannedFailoverOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientUnplannedFailoverResponse], errResp azfake.ErrorResponder) // BeginUpdate is the fake for method ReplicationRecoveryPlansClient.BeginUpdate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdate func(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input armrecoveryservicessiterecovery.UpdateRecoveryPlanInput, options *armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientBeginUpdateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientUpdateResponse], errResp azfake.ErrorResponder) + BeginUpdate func(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, input armrecoveryservicessiterecovery.UpdateRecoveryPlanInput, options *armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientBeginUpdateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientUpdateResponse], errResp azfake.ErrorResponder) } // NewReplicationRecoveryPlansServerTransport creates a new instance of ReplicationRecoveryPlansServerTransport with the provided implementation. @@ -173,11 +173,11 @@ func (r *ReplicationRecoveryPlansServerTransport) dispatchBeginCreate(req *http. if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -185,7 +185,7 @@ func (r *ReplicationRecoveryPlansServerTransport) dispatchBeginCreate(req *http. if err != nil { return nil, err } - respr, errRespr := r.srv.BeginCreate(req.Context(), resourceNameParam, resourceGroupNameParam, recoveryPlanNameParam, body, nil) + respr, errRespr := r.srv.BeginCreate(req.Context(), resourceGroupNameParam, resourceNameParam, recoveryPlanNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -221,11 +221,11 @@ func (r *ReplicationRecoveryPlansServerTransport) dispatchBeginDelete(req *http. if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -233,7 +233,7 @@ func (r *ReplicationRecoveryPlansServerTransport) dispatchBeginDelete(req *http. if err != nil { return nil, err } - respr, errRespr := r.srv.BeginDelete(req.Context(), resourceNameParam, resourceGroupNameParam, recoveryPlanNameParam, nil) + respr, errRespr := r.srv.BeginDelete(req.Context(), resourceGroupNameParam, resourceNameParam, recoveryPlanNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -269,11 +269,11 @@ func (r *ReplicationRecoveryPlansServerTransport) dispatchBeginFailoverCancel(re if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -281,7 +281,7 @@ func (r *ReplicationRecoveryPlansServerTransport) dispatchBeginFailoverCancel(re if err != nil { return nil, err } - respr, errRespr := r.srv.BeginFailoverCancel(req.Context(), resourceNameParam, resourceGroupNameParam, recoveryPlanNameParam, nil) + respr, errRespr := r.srv.BeginFailoverCancel(req.Context(), resourceGroupNameParam, resourceNameParam, recoveryPlanNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -317,11 +317,11 @@ func (r *ReplicationRecoveryPlansServerTransport) dispatchBeginFailoverCommit(re if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -329,7 +329,7 @@ func (r *ReplicationRecoveryPlansServerTransport) dispatchBeginFailoverCommit(re if err != nil { return nil, err } - respr, errRespr := r.srv.BeginFailoverCommit(req.Context(), resourceNameParam, resourceGroupNameParam, recoveryPlanNameParam, nil) + respr, errRespr := r.srv.BeginFailoverCommit(req.Context(), resourceGroupNameParam, resourceNameParam, recoveryPlanNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -363,11 +363,11 @@ func (r *ReplicationRecoveryPlansServerTransport) dispatchGet(req *http.Request) if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -375,7 +375,7 @@ func (r *ReplicationRecoveryPlansServerTransport) dispatchGet(req *http.Request) if err != nil { return nil, err } - respr, errRespr := r.srv.Get(req.Context(), resourceNameParam, resourceGroupNameParam, recoveryPlanNameParam, nil) + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, recoveryPlanNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -402,15 +402,15 @@ func (r *ReplicationRecoveryPlansServerTransport) dispatchNewListPager(req *http if matches == nil || len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } - resp := r.srv.NewListPager(resourceNameParam, resourceGroupNameParam, nil) + resp := r.srv.NewListPager(resourceGroupNameParam, resourceNameParam, nil) newListPager = &resp r.newListPager.add(req, newListPager) server.PagerResponderInjectNextLinks(newListPager, req, func(page *armrecoveryservicessiterecovery.ReplicationRecoveryPlansClientListResponse, createLink func() string) { @@ -447,11 +447,11 @@ func (r *ReplicationRecoveryPlansServerTransport) dispatchBeginPlannedFailover(r if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -459,7 +459,7 @@ func (r *ReplicationRecoveryPlansServerTransport) dispatchBeginPlannedFailover(r if err != nil { return nil, err } - respr, errRespr := r.srv.BeginPlannedFailover(req.Context(), resourceNameParam, resourceGroupNameParam, recoveryPlanNameParam, body, nil) + respr, errRespr := r.srv.BeginPlannedFailover(req.Context(), resourceGroupNameParam, resourceNameParam, recoveryPlanNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -495,11 +495,11 @@ func (r *ReplicationRecoveryPlansServerTransport) dispatchBeginReprotect(req *ht if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -507,7 +507,7 @@ func (r *ReplicationRecoveryPlansServerTransport) dispatchBeginReprotect(req *ht if err != nil { return nil, err } - respr, errRespr := r.srv.BeginReprotect(req.Context(), resourceNameParam, resourceGroupNameParam, recoveryPlanNameParam, nil) + respr, errRespr := r.srv.BeginReprotect(req.Context(), resourceGroupNameParam, resourceNameParam, recoveryPlanNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -547,11 +547,11 @@ func (r *ReplicationRecoveryPlansServerTransport) dispatchBeginTestFailover(req if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -559,7 +559,7 @@ func (r *ReplicationRecoveryPlansServerTransport) dispatchBeginTestFailover(req if err != nil { return nil, err } - respr, errRespr := r.srv.BeginTestFailover(req.Context(), resourceNameParam, resourceGroupNameParam, recoveryPlanNameParam, body, nil) + respr, errRespr := r.srv.BeginTestFailover(req.Context(), resourceGroupNameParam, resourceNameParam, recoveryPlanNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -599,11 +599,11 @@ func (r *ReplicationRecoveryPlansServerTransport) dispatchBeginTestFailoverClean if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -611,7 +611,7 @@ func (r *ReplicationRecoveryPlansServerTransport) dispatchBeginTestFailoverClean if err != nil { return nil, err } - respr, errRespr := r.srv.BeginTestFailoverCleanup(req.Context(), resourceNameParam, resourceGroupNameParam, recoveryPlanNameParam, body, nil) + respr, errRespr := r.srv.BeginTestFailoverCleanup(req.Context(), resourceGroupNameParam, resourceNameParam, recoveryPlanNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -651,11 +651,11 @@ func (r *ReplicationRecoveryPlansServerTransport) dispatchBeginUnplannedFailover if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -663,7 +663,7 @@ func (r *ReplicationRecoveryPlansServerTransport) dispatchBeginUnplannedFailover if err != nil { return nil, err } - respr, errRespr := r.srv.BeginUnplannedFailover(req.Context(), resourceNameParam, resourceGroupNameParam, recoveryPlanNameParam, body, nil) + respr, errRespr := r.srv.BeginUnplannedFailover(req.Context(), resourceGroupNameParam, resourceNameParam, recoveryPlanNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -703,11 +703,11 @@ func (r *ReplicationRecoveryPlansServerTransport) dispatchBeginUpdate(req *http. if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -715,7 +715,7 @@ func (r *ReplicationRecoveryPlansServerTransport) dispatchBeginUpdate(req *http. if err != nil { return nil, err } - respr, errRespr := r.srv.BeginUpdate(req.Context(), resourceNameParam, resourceGroupNameParam, recoveryPlanNameParam, body, nil) + respr, errRespr := r.srv.BeginUpdate(req.Context(), resourceGroupNameParam, resourceNameParam, recoveryPlanNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationrecoveryservicesproviders_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationrecoveryservicesproviders_server.go index bafe6d1c9910..ce8a438edeaa 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationrecoveryservicesproviders_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationrecoveryservicesproviders_server.go @@ -26,31 +26,31 @@ import ( type ReplicationRecoveryServicesProvidersServer struct { // BeginCreate is the fake for method ReplicationRecoveryServicesProvidersClient.BeginCreate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginCreate func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, providerName string, addProviderInput armrecoveryservicessiterecovery.AddRecoveryServicesProviderInput, options *armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientCreateResponse], errResp azfake.ErrorResponder) + BeginCreate func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, providerName string, addProviderInput armrecoveryservicessiterecovery.AddRecoveryServicesProviderInput, options *armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientCreateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method ReplicationRecoveryServicesProvidersClient.BeginDelete // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, providerName string, options *armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientBeginDeleteOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientDeleteResponse], errResp azfake.ErrorResponder) + BeginDelete func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, providerName string, options *armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientBeginDeleteOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method ReplicationRecoveryServicesProvidersClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, providerName string, options *armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, providerName string, options *armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientGetResponse], errResp azfake.ErrorResponder) // NewListPager is the fake for method ReplicationRecoveryServicesProvidersClient.NewListPager // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceName string, resourceGroupName string, options *armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientListResponse]) + NewListPager func(resourceGroupName string, resourceName string, options *armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientListResponse]) // NewListByReplicationFabricsPager is the fake for method ReplicationRecoveryServicesProvidersClient.NewListByReplicationFabricsPager // HTTP status codes to indicate success: http.StatusOK - NewListByReplicationFabricsPager func(resourceName string, resourceGroupName string, fabricName string, options *armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientListByReplicationFabricsOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientListByReplicationFabricsResponse]) + NewListByReplicationFabricsPager func(resourceGroupName string, resourceName string, fabricName string, options *armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientListByReplicationFabricsOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientListByReplicationFabricsResponse]) // BeginPurge is the fake for method ReplicationRecoveryServicesProvidersClient.BeginPurge // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginPurge func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, providerName string, options *armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientBeginPurgeOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientPurgeResponse], errResp azfake.ErrorResponder) + BeginPurge func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, providerName string, options *armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientBeginPurgeOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientPurgeResponse], errResp azfake.ErrorResponder) // BeginRefreshProvider is the fake for method ReplicationRecoveryServicesProvidersClient.BeginRefreshProvider // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginRefreshProvider func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, providerName string, options *armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientBeginRefreshProviderOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientRefreshProviderResponse], errResp azfake.ErrorResponder) + BeginRefreshProvider func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, providerName string, options *armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientBeginRefreshProviderOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientRefreshProviderResponse], errResp azfake.ErrorResponder) } // NewReplicationRecoveryServicesProvidersServerTransport creates a new instance of ReplicationRecoveryServicesProvidersServerTransport with the provided implementation. @@ -133,11 +133,11 @@ func (r *ReplicationRecoveryServicesProvidersServerTransport) dispatchBeginCreat if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -149,7 +149,7 @@ func (r *ReplicationRecoveryServicesProvidersServerTransport) dispatchBeginCreat if err != nil { return nil, err } - respr, errRespr := r.srv.BeginCreate(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, providerNameParam, body, nil) + respr, errRespr := r.srv.BeginCreate(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, providerNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -185,11 +185,11 @@ func (r *ReplicationRecoveryServicesProvidersServerTransport) dispatchBeginDelet if matches == nil || len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -201,7 +201,7 @@ func (r *ReplicationRecoveryServicesProvidersServerTransport) dispatchBeginDelet if err != nil { return nil, err } - respr, errRespr := r.srv.BeginDelete(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, providerNameParam, nil) + respr, errRespr := r.srv.BeginDelete(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, providerNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -235,11 +235,11 @@ func (r *ReplicationRecoveryServicesProvidersServerTransport) dispatchGet(req *h if matches == nil || len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -251,7 +251,7 @@ func (r *ReplicationRecoveryServicesProvidersServerTransport) dispatchGet(req *h if err != nil { return nil, err } - respr, errRespr := r.srv.Get(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, providerNameParam, nil) + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, providerNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -278,15 +278,15 @@ func (r *ReplicationRecoveryServicesProvidersServerTransport) dispatchNewListPag if matches == nil || len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } - resp := r.srv.NewListPager(resourceNameParam, resourceGroupNameParam, nil) + resp := r.srv.NewListPager(resourceGroupNameParam, resourceNameParam, nil) newListPager = &resp r.newListPager.add(req, newListPager) server.PagerResponderInjectNextLinks(newListPager, req, func(page *armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientListResponse, createLink func() string) { @@ -319,11 +319,11 @@ func (r *ReplicationRecoveryServicesProvidersServerTransport) dispatchNewListByR if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -331,7 +331,7 @@ func (r *ReplicationRecoveryServicesProvidersServerTransport) dispatchNewListByR if err != nil { return nil, err } - resp := r.srv.NewListByReplicationFabricsPager(resourceNameParam, resourceGroupNameParam, fabricNameParam, nil) + resp := r.srv.NewListByReplicationFabricsPager(resourceGroupNameParam, resourceNameParam, fabricNameParam, nil) newListByReplicationFabricsPager = &resp r.newListByReplicationFabricsPager.add(req, newListByReplicationFabricsPager) server.PagerResponderInjectNextLinks(newListByReplicationFabricsPager, req, func(page *armrecoveryservicessiterecovery.ReplicationRecoveryServicesProvidersClientListByReplicationFabricsResponse, createLink func() string) { @@ -364,11 +364,11 @@ func (r *ReplicationRecoveryServicesProvidersServerTransport) dispatchBeginPurge if matches == nil || len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -380,7 +380,7 @@ func (r *ReplicationRecoveryServicesProvidersServerTransport) dispatchBeginPurge if err != nil { return nil, err } - respr, errRespr := r.srv.BeginPurge(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, providerNameParam, nil) + respr, errRespr := r.srv.BeginPurge(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, providerNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -416,11 +416,11 @@ func (r *ReplicationRecoveryServicesProvidersServerTransport) dispatchBeginRefre if matches == nil || len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -432,7 +432,7 @@ func (r *ReplicationRecoveryServicesProvidersServerTransport) dispatchBeginRefre if err != nil { return nil, err } - respr, errRespr := r.srv.BeginRefreshProvider(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, providerNameParam, nil) + respr, errRespr := r.srv.BeginRefreshProvider(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, providerNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationstorageclassificationmappings_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationstorageclassificationmappings_server.go index 16407f97f774..8da5cb1f7a28 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationstorageclassificationmappings_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationstorageclassificationmappings_server.go @@ -26,23 +26,23 @@ import ( type ReplicationStorageClassificationMappingsServer struct { // BeginCreate is the fake for method ReplicationStorageClassificationMappingsClient.BeginCreate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginCreate func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput armrecoveryservicessiterecovery.StorageClassificationMappingInput, options *armrecoveryservicessiterecovery.ReplicationStorageClassificationMappingsClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationStorageClassificationMappingsClientCreateResponse], errResp azfake.ErrorResponder) + BeginCreate func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput armrecoveryservicessiterecovery.StorageClassificationMappingInput, options *armrecoveryservicessiterecovery.ReplicationStorageClassificationMappingsClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationStorageClassificationMappingsClientCreateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method ReplicationStorageClassificationMappingsClient.BeginDelete // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, storageClassificationName string, storageClassificationMappingName string, options *armrecoveryservicessiterecovery.ReplicationStorageClassificationMappingsClientBeginDeleteOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationStorageClassificationMappingsClientDeleteResponse], errResp azfake.ErrorResponder) + BeginDelete func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, storageClassificationName string, storageClassificationMappingName string, options *armrecoveryservicessiterecovery.ReplicationStorageClassificationMappingsClientBeginDeleteOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationStorageClassificationMappingsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method ReplicationStorageClassificationMappingsClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, storageClassificationName string, storageClassificationMappingName string, options *armrecoveryservicessiterecovery.ReplicationStorageClassificationMappingsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationStorageClassificationMappingsClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, storageClassificationName string, storageClassificationMappingName string, options *armrecoveryservicessiterecovery.ReplicationStorageClassificationMappingsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationStorageClassificationMappingsClientGetResponse], errResp azfake.ErrorResponder) // NewListPager is the fake for method ReplicationStorageClassificationMappingsClient.NewListPager // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceName string, resourceGroupName string, options *armrecoveryservicessiterecovery.ReplicationStorageClassificationMappingsClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationStorageClassificationMappingsClientListResponse]) + NewListPager func(resourceGroupName string, resourceName string, options *armrecoveryservicessiterecovery.ReplicationStorageClassificationMappingsClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationStorageClassificationMappingsClientListResponse]) // NewListByReplicationStorageClassificationsPager is the fake for method ReplicationStorageClassificationMappingsClient.NewListByReplicationStorageClassificationsPager // HTTP status codes to indicate success: http.StatusOK - NewListByReplicationStorageClassificationsPager func(resourceName string, resourceGroupName string, fabricName string, storageClassificationName string, options *armrecoveryservicessiterecovery.ReplicationStorageClassificationMappingsClientListByReplicationStorageClassificationsOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationStorageClassificationMappingsClientListByReplicationStorageClassificationsResponse]) + NewListByReplicationStorageClassificationsPager func(resourceGroupName string, resourceName string, fabricName string, storageClassificationName string, options *armrecoveryservicessiterecovery.ReplicationStorageClassificationMappingsClientListByReplicationStorageClassificationsOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationStorageClassificationMappingsClientListByReplicationStorageClassificationsResponse]) } // NewReplicationStorageClassificationMappingsServerTransport creates a new instance of ReplicationStorageClassificationMappingsServerTransport with the provided implementation. @@ -117,11 +117,11 @@ func (r *ReplicationStorageClassificationMappingsServerTransport) dispatchBeginC if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -137,7 +137,7 @@ func (r *ReplicationStorageClassificationMappingsServerTransport) dispatchBeginC if err != nil { return nil, err } - respr, errRespr := r.srv.BeginCreate(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, storageClassificationNameParam, storageClassificationMappingNameParam, body, nil) + respr, errRespr := r.srv.BeginCreate(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, storageClassificationNameParam, storageClassificationMappingNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -173,11 +173,11 @@ func (r *ReplicationStorageClassificationMappingsServerTransport) dispatchBeginD if matches == nil || len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -193,7 +193,7 @@ func (r *ReplicationStorageClassificationMappingsServerTransport) dispatchBeginD if err != nil { return nil, err } - respr, errRespr := r.srv.BeginDelete(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, storageClassificationNameParam, storageClassificationMappingNameParam, nil) + respr, errRespr := r.srv.BeginDelete(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, storageClassificationNameParam, storageClassificationMappingNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -227,11 +227,11 @@ func (r *ReplicationStorageClassificationMappingsServerTransport) dispatchGet(re if matches == nil || len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -247,7 +247,7 @@ func (r *ReplicationStorageClassificationMappingsServerTransport) dispatchGet(re if err != nil { return nil, err } - respr, errRespr := r.srv.Get(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, storageClassificationNameParam, storageClassificationMappingNameParam, nil) + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, storageClassificationNameParam, storageClassificationMappingNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -274,15 +274,15 @@ func (r *ReplicationStorageClassificationMappingsServerTransport) dispatchNewLis if matches == nil || len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } - resp := r.srv.NewListPager(resourceNameParam, resourceGroupNameParam, nil) + resp := r.srv.NewListPager(resourceGroupNameParam, resourceNameParam, nil) newListPager = &resp r.newListPager.add(req, newListPager) server.PagerResponderInjectNextLinks(newListPager, req, func(page *armrecoveryservicessiterecovery.ReplicationStorageClassificationMappingsClientListResponse, createLink func() string) { @@ -315,11 +315,11 @@ func (r *ReplicationStorageClassificationMappingsServerTransport) dispatchNewLis if matches == nil || len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -331,7 +331,7 @@ func (r *ReplicationStorageClassificationMappingsServerTransport) dispatchNewLis if err != nil { return nil, err } - resp := r.srv.NewListByReplicationStorageClassificationsPager(resourceNameParam, resourceGroupNameParam, fabricNameParam, storageClassificationNameParam, nil) + resp := r.srv.NewListByReplicationStorageClassificationsPager(resourceGroupNameParam, resourceNameParam, fabricNameParam, storageClassificationNameParam, nil) newListByReplicationStorageClassificationsPager = &resp r.newListByReplicationStorageClassificationsPager.add(req, newListByReplicationStorageClassificationsPager) server.PagerResponderInjectNextLinks(newListByReplicationStorageClassificationsPager, req, func(page *armrecoveryservicessiterecovery.ReplicationStorageClassificationMappingsClientListByReplicationStorageClassificationsResponse, createLink func() string) { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationstorageclassifications_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationstorageclassifications_server.go index a1c3d287d92f..eab6823e2601 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationstorageclassifications_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationstorageclassifications_server.go @@ -26,15 +26,15 @@ import ( type ReplicationStorageClassificationsServer struct { // Get is the fake for method ReplicationStorageClassificationsClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, storageClassificationName string, options *armrecoveryservicessiterecovery.ReplicationStorageClassificationsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationStorageClassificationsClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, storageClassificationName string, options *armrecoveryservicessiterecovery.ReplicationStorageClassificationsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationStorageClassificationsClientGetResponse], errResp azfake.ErrorResponder) // NewListPager is the fake for method ReplicationStorageClassificationsClient.NewListPager // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceName string, resourceGroupName string, options *armrecoveryservicessiterecovery.ReplicationStorageClassificationsClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationStorageClassificationsClientListResponse]) + NewListPager func(resourceGroupName string, resourceName string, options *armrecoveryservicessiterecovery.ReplicationStorageClassificationsClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationStorageClassificationsClientListResponse]) // NewListByReplicationFabricsPager is the fake for method ReplicationStorageClassificationsClient.NewListByReplicationFabricsPager // HTTP status codes to indicate success: http.StatusOK - NewListByReplicationFabricsPager func(resourceName string, resourceGroupName string, fabricName string, options *armrecoveryservicessiterecovery.ReplicationStorageClassificationsClientListByReplicationFabricsOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationStorageClassificationsClientListByReplicationFabricsResponse]) + NewListByReplicationFabricsPager func(resourceGroupName string, resourceName string, fabricName string, options *armrecoveryservicessiterecovery.ReplicationStorageClassificationsClientListByReplicationFabricsOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationStorageClassificationsClientListByReplicationFabricsResponse]) } // NewReplicationStorageClassificationsServerTransport creates a new instance of ReplicationStorageClassificationsServerTransport with the provided implementation. @@ -95,11 +95,11 @@ func (r *ReplicationStorageClassificationsServerTransport) dispatchGet(req *http if matches == nil || len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -111,7 +111,7 @@ func (r *ReplicationStorageClassificationsServerTransport) dispatchGet(req *http if err != nil { return nil, err } - respr, errRespr := r.srv.Get(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, storageClassificationNameParam, nil) + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, storageClassificationNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -138,15 +138,15 @@ func (r *ReplicationStorageClassificationsServerTransport) dispatchNewListPager( if matches == nil || len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } - resp := r.srv.NewListPager(resourceNameParam, resourceGroupNameParam, nil) + resp := r.srv.NewListPager(resourceGroupNameParam, resourceNameParam, nil) newListPager = &resp r.newListPager.add(req, newListPager) server.PagerResponderInjectNextLinks(newListPager, req, func(page *armrecoveryservicessiterecovery.ReplicationStorageClassificationsClientListResponse, createLink func() string) { @@ -179,11 +179,11 @@ func (r *ReplicationStorageClassificationsServerTransport) dispatchNewListByRepl if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -191,7 +191,7 @@ func (r *ReplicationStorageClassificationsServerTransport) dispatchNewListByRepl if err != nil { return nil, err } - resp := r.srv.NewListByReplicationFabricsPager(resourceNameParam, resourceGroupNameParam, fabricNameParam, nil) + resp := r.srv.NewListByReplicationFabricsPager(resourceGroupNameParam, resourceNameParam, fabricNameParam, nil) newListByReplicationFabricsPager = &resp r.newListByReplicationFabricsPager.add(req, newListByReplicationFabricsPager) server.PagerResponderInjectNextLinks(newListByReplicationFabricsPager, req, func(page *armrecoveryservicessiterecovery.ReplicationStorageClassificationsClientListByReplicationFabricsResponse, createLink func() string) { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationvaulthealth_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationvaulthealth_server.go index 4f48cad33323..9918a51b3359 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationvaulthealth_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationvaulthealth_server.go @@ -25,11 +25,11 @@ import ( type ReplicationVaultHealthServer struct { // Get is the fake for method ReplicationVaultHealthClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceName string, resourceGroupName string, options *armrecoveryservicessiterecovery.ReplicationVaultHealthClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationVaultHealthClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, resourceName string, options *armrecoveryservicessiterecovery.ReplicationVaultHealthClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationVaultHealthClientGetResponse], errResp azfake.ErrorResponder) // BeginRefresh is the fake for method ReplicationVaultHealthClient.BeginRefresh // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginRefresh func(ctx context.Context, resourceName string, resourceGroupName string, options *armrecoveryservicessiterecovery.ReplicationVaultHealthClientBeginRefreshOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationVaultHealthClientRefreshResponse], errResp azfake.ErrorResponder) + BeginRefresh func(ctx context.Context, resourceGroupName string, resourceName string, options *armrecoveryservicessiterecovery.ReplicationVaultHealthClientBeginRefreshOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationVaultHealthClientRefreshResponse], errResp azfake.ErrorResponder) } // NewReplicationVaultHealthServerTransport creates a new instance of ReplicationVaultHealthServerTransport with the provided implementation. @@ -86,15 +86,15 @@ func (r *ReplicationVaultHealthServerTransport) dispatchGet(req *http.Request) ( if matches == nil || len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } - respr, errRespr := r.srv.Get(req.Context(), resourceNameParam, resourceGroupNameParam, nil) + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -121,15 +121,15 @@ func (r *ReplicationVaultHealthServerTransport) dispatchBeginRefresh(req *http.R if matches == nil || len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } - respr, errRespr := r.srv.BeginRefresh(req.Context(), resourceNameParam, resourceGroupNameParam, nil) + respr, errRespr := r.srv.BeginRefresh(req.Context(), resourceGroupNameParam, resourceNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationvaultsetting_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationvaultsetting_server.go index 53a260cf250f..89675dc46394 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationvaultsetting_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationvaultsetting_server.go @@ -26,15 +26,15 @@ import ( type ReplicationVaultSettingServer struct { // BeginCreate is the fake for method ReplicationVaultSettingClient.BeginCreate // HTTP status codes to indicate success: http.StatusOK - BeginCreate func(ctx context.Context, resourceName string, resourceGroupName string, vaultSettingName string, input armrecoveryservicessiterecovery.VaultSettingCreationInput, options *armrecoveryservicessiterecovery.ReplicationVaultSettingClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationVaultSettingClientCreateResponse], errResp azfake.ErrorResponder) + BeginCreate func(ctx context.Context, resourceGroupName string, resourceName string, vaultSettingName string, input armrecoveryservicessiterecovery.VaultSettingCreationInput, options *armrecoveryservicessiterecovery.ReplicationVaultSettingClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationVaultSettingClientCreateResponse], errResp azfake.ErrorResponder) // Get is the fake for method ReplicationVaultSettingClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceName string, resourceGroupName string, vaultSettingName string, options *armrecoveryservicessiterecovery.ReplicationVaultSettingClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationVaultSettingClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, resourceName string, vaultSettingName string, options *armrecoveryservicessiterecovery.ReplicationVaultSettingClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationVaultSettingClientGetResponse], errResp azfake.ErrorResponder) // NewListPager is the fake for method ReplicationVaultSettingClient.NewListPager // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceName string, resourceGroupName string, options *armrecoveryservicessiterecovery.ReplicationVaultSettingClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationVaultSettingClientListResponse]) + NewListPager func(resourceGroupName string, resourceName string, options *armrecoveryservicessiterecovery.ReplicationVaultSettingClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationVaultSettingClientListResponse]) } // NewReplicationVaultSettingServerTransport creates a new instance of ReplicationVaultSettingServerTransport with the provided implementation. @@ -101,11 +101,11 @@ func (r *ReplicationVaultSettingServerTransport) dispatchBeginCreate(req *http.R if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -113,7 +113,7 @@ func (r *ReplicationVaultSettingServerTransport) dispatchBeginCreate(req *http.R if err != nil { return nil, err } - respr, errRespr := r.srv.BeginCreate(req.Context(), resourceNameParam, resourceGroupNameParam, vaultSettingNameParam, body, nil) + respr, errRespr := r.srv.BeginCreate(req.Context(), resourceGroupNameParam, resourceNameParam, vaultSettingNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -147,11 +147,11 @@ func (r *ReplicationVaultSettingServerTransport) dispatchGet(req *http.Request) if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -159,7 +159,7 @@ func (r *ReplicationVaultSettingServerTransport) dispatchGet(req *http.Request) if err != nil { return nil, err } - respr, errRespr := r.srv.Get(req.Context(), resourceNameParam, resourceGroupNameParam, vaultSettingNameParam, nil) + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, vaultSettingNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -186,15 +186,15 @@ func (r *ReplicationVaultSettingServerTransport) dispatchNewListPager(req *http. if matches == nil || len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } - resp := r.srv.NewListPager(resourceNameParam, resourceGroupNameParam, nil) + resp := r.srv.NewListPager(resourceGroupNameParam, resourceNameParam, nil) newListPager = &resp r.newListPager.add(req, newListPager) server.PagerResponderInjectNextLinks(newListPager, req, func(page *armrecoveryservicessiterecovery.ReplicationVaultSettingClientListResponse, createLink func() string) { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationvcenters_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationvcenters_server.go index 55f7007d80dd..300d8bcec4b4 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationvcenters_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/replicationvcenters_server.go @@ -26,27 +26,27 @@ import ( type ReplicationvCentersServer struct { // BeginCreate is the fake for method ReplicationvCentersClient.BeginCreate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginCreate func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, vcenterName string, addVCenterRequest armrecoveryservicessiterecovery.AddVCenterRequest, options *armrecoveryservicessiterecovery.ReplicationvCentersClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationvCentersClientCreateResponse], errResp azfake.ErrorResponder) + BeginCreate func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, vcenterName string, addVCenterRequest armrecoveryservicessiterecovery.AddVCenterRequest, options *armrecoveryservicessiterecovery.ReplicationvCentersClientBeginCreateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationvCentersClientCreateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method ReplicationvCentersClient.BeginDelete // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, vcenterName string, options *armrecoveryservicessiterecovery.ReplicationvCentersClientBeginDeleteOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationvCentersClientDeleteResponse], errResp azfake.ErrorResponder) + BeginDelete func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, vcenterName string, options *armrecoveryservicessiterecovery.ReplicationvCentersClientBeginDeleteOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationvCentersClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method ReplicationvCentersClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, vcenterName string, options *armrecoveryservicessiterecovery.ReplicationvCentersClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationvCentersClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, vcenterName string, options *armrecoveryservicessiterecovery.ReplicationvCentersClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.ReplicationvCentersClientGetResponse], errResp azfake.ErrorResponder) // NewListPager is the fake for method ReplicationvCentersClient.NewListPager // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceName string, resourceGroupName string, options *armrecoveryservicessiterecovery.ReplicationvCentersClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationvCentersClientListResponse]) + NewListPager func(resourceGroupName string, resourceName string, options *armrecoveryservicessiterecovery.ReplicationvCentersClientListOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationvCentersClientListResponse]) // NewListByReplicationFabricsPager is the fake for method ReplicationvCentersClient.NewListByReplicationFabricsPager // HTTP status codes to indicate success: http.StatusOK - NewListByReplicationFabricsPager func(resourceName string, resourceGroupName string, fabricName string, options *armrecoveryservicessiterecovery.ReplicationvCentersClientListByReplicationFabricsOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationvCentersClientListByReplicationFabricsResponse]) + NewListByReplicationFabricsPager func(resourceGroupName string, resourceName string, fabricName string, options *armrecoveryservicessiterecovery.ReplicationvCentersClientListByReplicationFabricsOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.ReplicationvCentersClientListByReplicationFabricsResponse]) // BeginUpdate is the fake for method ReplicationvCentersClient.BeginUpdate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdate func(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, vcenterName string, updateVCenterRequest armrecoveryservicessiterecovery.UpdateVCenterRequest, options *armrecoveryservicessiterecovery.ReplicationvCentersClientBeginUpdateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationvCentersClientUpdateResponse], errResp azfake.ErrorResponder) + BeginUpdate func(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, vcenterName string, updateVCenterRequest armrecoveryservicessiterecovery.UpdateVCenterRequest, options *armrecoveryservicessiterecovery.ReplicationvCentersClientBeginUpdateOptions) (resp azfake.PollerResponder[armrecoveryservicessiterecovery.ReplicationvCentersClientUpdateResponse], errResp azfake.ErrorResponder) } // NewReplicationvCentersServerTransport creates a new instance of ReplicationvCentersServerTransport with the provided implementation. @@ -125,11 +125,11 @@ func (r *ReplicationvCentersServerTransport) dispatchBeginCreate(req *http.Reque if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -141,7 +141,7 @@ func (r *ReplicationvCentersServerTransport) dispatchBeginCreate(req *http.Reque if err != nil { return nil, err } - respr, errRespr := r.srv.BeginCreate(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, vcenterNameParam, body, nil) + respr, errRespr := r.srv.BeginCreate(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, vcenterNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -177,11 +177,11 @@ func (r *ReplicationvCentersServerTransport) dispatchBeginDelete(req *http.Reque if matches == nil || len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -193,7 +193,7 @@ func (r *ReplicationvCentersServerTransport) dispatchBeginDelete(req *http.Reque if err != nil { return nil, err } - respr, errRespr := r.srv.BeginDelete(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, vcenterNameParam, nil) + respr, errRespr := r.srv.BeginDelete(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, vcenterNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -227,11 +227,11 @@ func (r *ReplicationvCentersServerTransport) dispatchGet(req *http.Request) (*ht if matches == nil || len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -243,7 +243,7 @@ func (r *ReplicationvCentersServerTransport) dispatchGet(req *http.Request) (*ht if err != nil { return nil, err } - respr, errRespr := r.srv.Get(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, vcenterNameParam, nil) + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, vcenterNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -270,15 +270,15 @@ func (r *ReplicationvCentersServerTransport) dispatchNewListPager(req *http.Requ if matches == nil || len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } - resp := r.srv.NewListPager(resourceNameParam, resourceGroupNameParam, nil) + resp := r.srv.NewListPager(resourceGroupNameParam, resourceNameParam, nil) newListPager = &resp r.newListPager.add(req, newListPager) server.PagerResponderInjectNextLinks(newListPager, req, func(page *armrecoveryservicessiterecovery.ReplicationvCentersClientListResponse, createLink func() string) { @@ -311,11 +311,11 @@ func (r *ReplicationvCentersServerTransport) dispatchNewListByReplicationFabrics if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -323,7 +323,7 @@ func (r *ReplicationvCentersServerTransport) dispatchNewListByReplicationFabrics if err != nil { return nil, err } - resp := r.srv.NewListByReplicationFabricsPager(resourceNameParam, resourceGroupNameParam, fabricNameParam, nil) + resp := r.srv.NewListByReplicationFabricsPager(resourceGroupNameParam, resourceNameParam, fabricNameParam, nil) newListByReplicationFabricsPager = &resp r.newListByReplicationFabricsPager.add(req, newListByReplicationFabricsPager) server.PagerResponderInjectNextLinks(newListByReplicationFabricsPager, req, func(page *armrecoveryservicessiterecovery.ReplicationvCentersClientListByReplicationFabricsResponse, createLink func() string) { @@ -360,11 +360,11 @@ func (r *ReplicationvCentersServerTransport) dispatchBeginUpdate(req *http.Reque if err != nil { return nil, err } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -376,7 +376,7 @@ func (r *ReplicationvCentersServerTransport) dispatchBeginUpdate(req *http.Reque if err != nil { return nil, err } - respr, errRespr := r.srv.BeginUpdate(req.Context(), resourceNameParam, resourceGroupNameParam, fabricNameParam, vcenterNameParam, body, nil) + respr, errRespr := r.srv.BeginUpdate(req.Context(), resourceGroupNameParam, resourceNameParam, fabricNameParam, vcenterNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/server_factory.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/server_factory.go index 09b35a6095b1..c58eb2f706a7 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/server_factory.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/server_factory.go @@ -19,6 +19,8 @@ import ( // ServerFactory is a fake server for instances of the armrecoveryservicessiterecovery.ClientFactory type. type ServerFactory struct { + ClusterRecoveryPointServer ClusterRecoveryPointServer + ClusterRecoveryPointsServer ClusterRecoveryPointsServer MigrationRecoveryPointsServer MigrationRecoveryPointsServer OperationsServer OperationsServer RecoveryPointsServer RecoveryPointsServer @@ -35,6 +37,7 @@ type ServerFactory struct { ReplicationPoliciesServer ReplicationPoliciesServer ReplicationProtectableItemsServer ReplicationProtectableItemsServer ReplicationProtectedItemsServer ReplicationProtectedItemsServer + ReplicationProtectionClustersServer ReplicationProtectionClustersServer ReplicationProtectionContainerMappingsServer ReplicationProtectionContainerMappingsServer ReplicationProtectionContainersServer ReplicationProtectionContainersServer ReplicationProtectionIntentsServer ReplicationProtectionIntentsServer @@ -63,6 +66,8 @@ func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { type ServerFactoryTransport struct { srv *ServerFactory trMu sync.Mutex + trClusterRecoveryPointServer *ClusterRecoveryPointServerTransport + trClusterRecoveryPointsServer *ClusterRecoveryPointsServerTransport trMigrationRecoveryPointsServer *MigrationRecoveryPointsServerTransport trOperationsServer *OperationsServerTransport trRecoveryPointsServer *RecoveryPointsServerTransport @@ -79,6 +84,7 @@ type ServerFactoryTransport struct { trReplicationPoliciesServer *ReplicationPoliciesServerTransport trReplicationProtectableItemsServer *ReplicationProtectableItemsServerTransport trReplicationProtectedItemsServer *ReplicationProtectedItemsServerTransport + trReplicationProtectionClustersServer *ReplicationProtectionClustersServerTransport trReplicationProtectionContainerMappingsServer *ReplicationProtectionContainerMappingsServerTransport trReplicationProtectionContainersServer *ReplicationProtectionContainersServerTransport trReplicationProtectionIntentsServer *ReplicationProtectionIntentsServerTransport @@ -106,6 +112,16 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { var err error switch client { + case "ClusterRecoveryPointClient": + initServer(s, &s.trClusterRecoveryPointServer, func() *ClusterRecoveryPointServerTransport { + return NewClusterRecoveryPointServerTransport(&s.srv.ClusterRecoveryPointServer) + }) + resp, err = s.trClusterRecoveryPointServer.Do(req) + case "ClusterRecoveryPointsClient": + initServer(s, &s.trClusterRecoveryPointsServer, func() *ClusterRecoveryPointsServerTransport { + return NewClusterRecoveryPointsServerTransport(&s.srv.ClusterRecoveryPointsServer) + }) + resp, err = s.trClusterRecoveryPointsServer.Do(req) case "MigrationRecoveryPointsClient": initServer(s, &s.trMigrationRecoveryPointsServer, func() *MigrationRecoveryPointsServerTransport { return NewMigrationRecoveryPointsServerTransport(&s.srv.MigrationRecoveryPointsServer) @@ -184,6 +200,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewReplicationProtectedItemsServerTransport(&s.srv.ReplicationProtectedItemsServer) }) resp, err = s.trReplicationProtectedItemsServer.Do(req) + case "ReplicationProtectionClustersClient": + initServer(s, &s.trReplicationProtectionClustersServer, func() *ReplicationProtectionClustersServerTransport { + return NewReplicationProtectionClustersServerTransport(&s.srv.ReplicationProtectionClustersServer) + }) + resp, err = s.trReplicationProtectionClustersServer.Do(req) case "ReplicationProtectionContainerMappingsClient": initServer(s, &s.trReplicationProtectionContainerMappingsServer, func() *ReplicationProtectionContainerMappingsServerTransport { return NewReplicationProtectionContainerMappingsServerTransport(&s.srv.ReplicationProtectionContainerMappingsServer) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/supportedoperatingsystems_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/supportedoperatingsystems_server.go index 989a3870be53..a0ed8f489093 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/supportedoperatingsystems_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/supportedoperatingsystems_server.go @@ -25,7 +25,7 @@ import ( type SupportedOperatingSystemsServer struct { // Get is the fake for method SupportedOperatingSystemsClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceName string, resourceGroupName string, options *armrecoveryservicessiterecovery.SupportedOperatingSystemsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.SupportedOperatingSystemsClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, resourceName string, options *armrecoveryservicessiterecovery.SupportedOperatingSystemsClientGetOptions) (resp azfake.Responder[armrecoveryservicessiterecovery.SupportedOperatingSystemsClientGetResponse], errResp azfake.ErrorResponder) } // NewSupportedOperatingSystemsServerTransport creates a new instance of SupportedOperatingSystemsServerTransport with the provided implementation. @@ -77,11 +77,11 @@ func (s *SupportedOperatingSystemsServerTransport) dispatchGet(req *http.Request return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } qp := req.URL.Query() - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -96,7 +96,7 @@ func (s *SupportedOperatingSystemsServerTransport) dispatchGet(req *http.Request InstanceType: instanceTypeParam, } } - respr, errRespr := s.srv.Get(req.Context(), resourceNameParam, resourceGroupNameParam, options) + respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, options) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/targetcomputesizes_server.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/targetcomputesizes_server.go index b50dfc85969a..473914516cac 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/targetcomputesizes_server.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/fake/targetcomputesizes_server.go @@ -25,7 +25,7 @@ import ( type TargetComputeSizesServer struct { // NewListByReplicationProtectedItemsPager is the fake for method TargetComputeSizesClient.NewListByReplicationProtectedItemsPager // HTTP status codes to indicate success: http.StatusOK - NewListByReplicationProtectedItemsPager func(resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *armrecoveryservicessiterecovery.TargetComputeSizesClientListByReplicationProtectedItemsOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.TargetComputeSizesClientListByReplicationProtectedItemsResponse]) + NewListByReplicationProtectedItemsPager func(resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *armrecoveryservicessiterecovery.TargetComputeSizesClientListByReplicationProtectedItemsOptions) (resp azfake.PagerResponder[armrecoveryservicessiterecovery.TargetComputeSizesClientListByReplicationProtectedItemsResponse]) } // NewTargetComputeSizesServerTransport creates a new instance of TargetComputeSizesServerTransport with the provided implementation. @@ -82,11 +82,11 @@ func (t *TargetComputeSizesServerTransport) dispatchNewListByReplicationProtecte if matches == nil || len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) if err != nil { return nil, err } @@ -102,7 +102,7 @@ func (t *TargetComputeSizesServerTransport) dispatchNewListByReplicationProtecte if err != nil { return nil, err } - resp := t.srv.NewListByReplicationProtectedItemsPager(resourceNameParam, resourceGroupNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, nil) + resp := t.srv.NewListByReplicationProtectedItemsPager(resourceGroupNameParam, resourceNameParam, fabricNameParam, protectionContainerNameParam, replicatedProtectedItemNameParam, nil) newListByReplicationProtectedItemsPager = &resp t.newListByReplicationProtectedItemsPager.add(req, newListByReplicationProtectedItemsPager) server.PagerResponderInjectNextLinks(newListByReplicationProtectedItemsPager, req, func(page *armrecoveryservicessiterecovery.TargetComputeSizesClientListByReplicationProtectedItemsResponse, createLink func() string) { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/go.mod b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/go.mod index defcdca045c8..6c8523703df0 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/go.mod +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/go.mod @@ -2,20 +2,10 @@ 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.16.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.31.0 // indirect golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect ) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/go.sum b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/go.sum index 9620a8f197a3..823eafcd76d5 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/go.sum +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/go.sum @@ -1,35 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 h1:JZg6HRh6W6U4OLl6lk7BZ7BLisIzM9dG1R50zUk9C/M= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0/go.mod h1:YL1xnZ6QejvQHWJrX/AvhFl4WW4rqHVoKspWNVwFk0M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 h1:B/dfvscEQtew9dVuoxqxrUKKv8Ih2f55PydknDamU+g= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0/go.mod h1:fiPSssYvltE08HJchL04dOy+RD4hgrjph0cwGGMntdI= -github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.0 h1:+m0M/LFxN43KvULkDNfdXOgrjtg6UYJPFBJyuEcRCAw= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= -github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2 h1:kYRSnvJju5gYVyhkij+RTJ/VR6QIUaCfWeaFm2ycsjQ= -github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6 h1:IsMZxCuZqKuao2vNdfD82fjjgPLfyHLpR41Z88viRWs= -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-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/redis/go-redis/v9 v9.6.1 h1:HHDteefn6ZkTtY5fGUE8tj8uy85AHk6zP7CpzIAM0y4= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/interfaces.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/interfaces.go index 994859bc7cc5..623184b05ec8 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/interfaces.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/interfaces.go @@ -11,7 +11,7 @@ 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 +// - *A2AAddDisksInput, *AddDisksProviderSpecificInput, *InMageRcmAddDisksInput type AddDisksProviderSpecificInputClassification interface { // GetAddDisksProviderSpecificInput returns the AddDisksProviderSpecificInput content of the underlying type. GetAddDisksProviderSpecificInput() *AddDisksProviderSpecificInput @@ -26,6 +26,15 @@ type ApplianceSpecificDetailsClassification interface { GetApplianceSpecificDetails() *ApplianceSpecificDetails } +// ApplyClusterRecoveryPointProviderSpecificInputClassification provides polymorphic access to related types. +// Call the interface's GetApplyClusterRecoveryPointProviderSpecificInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2AApplyClusterRecoveryPointInput, *ApplyClusterRecoveryPointProviderSpecificInput +type ApplyClusterRecoveryPointProviderSpecificInputClassification interface { + // GetApplyClusterRecoveryPointProviderSpecificInput returns the ApplyClusterRecoveryPointProviderSpecificInput content of the underlying type. + GetApplyClusterRecoveryPointProviderSpecificInput() *ApplyClusterRecoveryPointProviderSpecificInput +} + // 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: @@ -36,6 +45,33 @@ type ApplyRecoveryPointProviderSpecificInputClassification interface { GetApplyRecoveryPointProviderSpecificInput() *ApplyRecoveryPointProviderSpecificInput } +// ClusterProviderSpecificRecoveryPointDetailsClassification provides polymorphic access to related types. +// Call the interface's GetClusterProviderSpecificRecoveryPointDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2AClusterRecoveryPointDetails, *ClusterProviderSpecificRecoveryPointDetails +type ClusterProviderSpecificRecoveryPointDetailsClassification interface { + // GetClusterProviderSpecificRecoveryPointDetails returns the ClusterProviderSpecificRecoveryPointDetails content of the underlying type. + GetClusterProviderSpecificRecoveryPointDetails() *ClusterProviderSpecificRecoveryPointDetails +} + +// ClusterTestFailoverProviderSpecificInputClassification provides polymorphic access to related types. +// Call the interface's GetClusterTestFailoverProviderSpecificInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2AClusterTestFailoverInput, *ClusterTestFailoverProviderSpecificInput +type ClusterTestFailoverProviderSpecificInputClassification interface { + // GetClusterTestFailoverProviderSpecificInput returns the ClusterTestFailoverProviderSpecificInput content of the underlying type. + GetClusterTestFailoverProviderSpecificInput() *ClusterTestFailoverProviderSpecificInput +} + +// ClusterUnplannedFailoverProviderSpecificInputClassification provides polymorphic access to related types. +// Call the interface's GetClusterUnplannedFailoverProviderSpecificInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2AClusterUnplannedFailoverInput, *ClusterUnplannedFailoverProviderSpecificInput +type ClusterUnplannedFailoverProviderSpecificInputClassification interface { + // GetClusterUnplannedFailoverProviderSpecificInput returns the ClusterUnplannedFailoverProviderSpecificInput content of the underlying type. + GetClusterUnplannedFailoverProviderSpecificInput() *ClusterUnplannedFailoverProviderSpecificInput +} + // 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: @@ -172,7 +208,8 @@ type HyperVVirtualMachineDetailsClassification interface { // 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 +// - *AsrJobDetails, *ClusterFailoverJobDetails, *ClusterSwitchProtectionJobDetails, *ClusterTestFailoverJobDetails, *ExportJobDetails, +// - *FailoverJobDetails, *JobDetails, *SwitchProtectionJobDetails, *TestFailoverJobDetails type JobDetailsClassification interface { // GetJobDetails returns the JobDetails content of the underlying type. GetJobDetails() *JobDetails @@ -368,6 +405,15 @@ type RemoveDisksProviderSpecificInputClassification interface { GetRemoveDisksProviderSpecificInput() *RemoveDisksProviderSpecificInput } +// ReplicationClusterProviderSpecificSettingsClassification provides polymorphic access to related types. +// Call the interface's GetReplicationClusterProviderSpecificSettings() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2AReplicationProtectionClusterDetails, *ReplicationClusterProviderSpecificSettings +type ReplicationClusterProviderSpecificSettingsClassification interface { + // GetReplicationClusterProviderSpecificSettings returns the ReplicationClusterProviderSpecificSettings content of the underlying type. + GetReplicationClusterProviderSpecificSettings() *ReplicationClusterProviderSpecificSettings +} + // 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: @@ -444,6 +490,15 @@ type ReverseReplicationProviderSpecificInputClassification interface { GetReverseReplicationProviderSpecificInput() *ReverseReplicationProviderSpecificInput } +// SharedDiskReplicationProviderSpecificSettingsClassification provides polymorphic access to related types. +// Call the interface's GetSharedDiskReplicationProviderSpecificSettings() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2ASharedDiskReplicationDetails, *SharedDiskReplicationProviderSpecificSettings +type SharedDiskReplicationProviderSpecificSettingsClassification interface { + // GetSharedDiskReplicationProviderSpecificSettings returns the SharedDiskReplicationProviderSpecificSettings content of the underlying type. + GetSharedDiskReplicationProviderSpecificSettings() *SharedDiskReplicationProviderSpecificSettings +} + // 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: @@ -453,6 +508,15 @@ type StorageAccountCustomDetailsClassification interface { GetStorageAccountCustomDetails() *StorageAccountCustomDetails } +// SwitchClusterProtectionProviderSpecificInputClassification provides polymorphic access to related types. +// Call the interface's GetSwitchClusterProtectionProviderSpecificInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *A2ASwitchClusterProtectionInput, *SwitchClusterProtectionProviderSpecificInput +type SwitchClusterProtectionProviderSpecificInputClassification interface { + // GetSwitchClusterProtectionProviderSpecificInput returns the SwitchClusterProtectionProviderSpecificInput content of the underlying type. + GetSwitchClusterProtectionProviderSpecificInput() *SwitchClusterProtectionProviderSpecificInput +} + // 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: diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/migrationrecoverypoints_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/migrationrecoverypoints_client.go index 0c26dfbb59b2..a0bae520f961 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/migrationrecoverypoints_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/migrationrecoverypoints_client.go @@ -46,22 +46,22 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric unique name. // - protectionContainerName - Protection container name. // - migrationItemName - Migration item name. // - migrationRecoveryPointName - The migration recovery point name. // - 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) { +func (client *MigrationRecoveryPointsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string, options *MigrationRecoveryPointsClientGetOptions) (MigrationRecoveryPointsClientGetResponse, error) { var err error const operationName = "MigrationRecoveryPointsClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, migrationRecoveryPointName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, migrationItemName, migrationRecoveryPointName, options) if err != nil { return MigrationRecoveryPointsClientGetResponse{}, err } @@ -78,16 +78,16 @@ func (client *MigrationRecoveryPointsClient) Get(ctx context.Context, resourceNa } // getCreateRequest creates the Get request. -func (client *MigrationRecoveryPointsClient) getCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string, options *MigrationRecoveryPointsClientGetOptions) (*policy.Request, error) { +func (client *MigrationRecoveryPointsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, migrationRecoveryPointName string, options *MigrationRecoveryPointsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints/{migrationRecoveryPointName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -113,7 +113,7 @@ func (client *MigrationRecoveryPointsClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -130,15 +130,15 @@ func (client *MigrationRecoveryPointsClient) getHandleResponse(resp *http.Respon // NewListByReplicationMigrationItemsPager - Gets the recovery points for a migration item. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric unique name. // - protectionContainerName - Protection container name. // - migrationItemName - Migration item name. // - options - MigrationRecoveryPointsClientListByReplicationMigrationItemsOptions contains the optional parameters for the // MigrationRecoveryPointsClient.NewListByReplicationMigrationItemsPager method. -func (client *MigrationRecoveryPointsClient) NewListByReplicationMigrationItemsPager(resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, options *MigrationRecoveryPointsClientListByReplicationMigrationItemsOptions) *runtime.Pager[MigrationRecoveryPointsClientListByReplicationMigrationItemsResponse] { +func (client *MigrationRecoveryPointsClient) NewListByReplicationMigrationItemsPager(resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, options *MigrationRecoveryPointsClientListByReplicationMigrationItemsOptions) *runtime.Pager[MigrationRecoveryPointsClientListByReplicationMigrationItemsResponse] { return runtime.NewPager(runtime.PagingHandler[MigrationRecoveryPointsClientListByReplicationMigrationItemsResponse]{ More: func(page MigrationRecoveryPointsClientListByReplicationMigrationItemsResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -150,7 +150,7 @@ func (client *MigrationRecoveryPointsClient) NewListByReplicationMigrationItemsP nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByReplicationMigrationItemsCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, options) + return client.listByReplicationMigrationItemsCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, migrationItemName, options) }, nil) if err != nil { return MigrationRecoveryPointsClientListByReplicationMigrationItemsResponse{}, err @@ -162,16 +162,16 @@ func (client *MigrationRecoveryPointsClient) NewListByReplicationMigrationItemsP } // listByReplicationMigrationItemsCreateRequest creates the ListByReplicationMigrationItems request. -func (client *MigrationRecoveryPointsClient) listByReplicationMigrationItemsCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, options *MigrationRecoveryPointsClientListByReplicationMigrationItemsOptions) (*policy.Request, error) { +func (client *MigrationRecoveryPointsClient) listByReplicationMigrationItemsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, options *MigrationRecoveryPointsClientListByReplicationMigrationItemsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -193,7 +193,7 @@ func (client *MigrationRecoveryPointsClient) listByReplicationMigrationItemsCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-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 32f8bab96a3f..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.808Z"); 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.972Z"); return t}()), - // RecoveryPointType: to.Ptr(armrecoveryservicessiterecovery.MigrationRecoveryPointTypeCrashConsistent), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.808Z"); return t}()), - // RecoveryPointType: to.Ptr(armrecoveryservicessiterecovery.MigrationRecoveryPointTypeCrashConsistent), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/models.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/models.go index 99e44d7fde91..cde84d2f1e60 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/models.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/models.go @@ -29,6 +29,20 @@ func (a *A2AAddDisksInput) GetAddDisksProviderSpecificInput() *AddDisksProviderS } } +// A2AApplyClusterRecoveryPointInput - A2A provider specific input for apply cluster recovery point. +type A2AApplyClusterRecoveryPointInput struct { + // REQUIRED; The class type. + InstanceType *string +} + +// GetApplyClusterRecoveryPointProviderSpecificInput implements the ApplyClusterRecoveryPointProviderSpecificInputClassification +// interface for type A2AApplyClusterRecoveryPointInput. +func (a *A2AApplyClusterRecoveryPointInput) GetApplyClusterRecoveryPointProviderSpecificInput() *ApplyClusterRecoveryPointProviderSpecificInput { + return &ApplyClusterRecoveryPointProviderSpecificInput{ + InstanceType: a.InstanceType, + } +} + // A2AApplyRecoveryPointInput - ApplyRecoveryPoint input specific to A2A provider. type A2AApplyRecoveryPointInput struct { // REQUIRED; The class type. @@ -43,6 +57,66 @@ func (a *A2AApplyRecoveryPointInput) GetApplyRecoveryPointProviderSpecificInput( } } +// A2AClusterRecoveryPointDetails - A2A provider specific cluster recovery point details. +type A2AClusterRecoveryPointDetails struct { + // The list of nodes representing the cluster. + Nodes []*string + + // A value indicating whether the recovery point is multi VM consistent. + RecoveryPointSyncType *RecoveryPointSyncType + + // READ-ONLY; Gets the provider type. + InstanceType *string +} + +// GetClusterProviderSpecificRecoveryPointDetails implements the ClusterProviderSpecificRecoveryPointDetailsClassification +// interface for type A2AClusterRecoveryPointDetails. +func (a *A2AClusterRecoveryPointDetails) GetClusterProviderSpecificRecoveryPointDetails() *ClusterProviderSpecificRecoveryPointDetails { + return &ClusterProviderSpecificRecoveryPointDetails{ + InstanceType: a.InstanceType, + } +} + +// A2AClusterTestFailoverInput - A2A provider specific input for test cluster failover. +type A2AClusterTestFailoverInput struct { + // REQUIRED; The class type. + InstanceType *string + + // The cluster recovery point id to be passed to failover to a particular recovery point. + ClusterRecoveryPointID *string + + // The list of individual node recovery points. + IndividualNodeRecoveryPoints []*string +} + +// GetClusterTestFailoverProviderSpecificInput implements the ClusterTestFailoverProviderSpecificInputClassification interface +// for type A2AClusterTestFailoverInput. +func (a *A2AClusterTestFailoverInput) GetClusterTestFailoverProviderSpecificInput() *ClusterTestFailoverProviderSpecificInput { + return &ClusterTestFailoverProviderSpecificInput{ + InstanceType: a.InstanceType, + } +} + +// A2AClusterUnplannedFailoverInput - A2A provider specific input for unplanned cluster failover. +type A2AClusterUnplannedFailoverInput struct { + // REQUIRED; The class type. + InstanceType *string + + // The cluster recovery point id to be passed to failover to a particular recovery point. + ClusterRecoveryPointID *string + + // The list of individual node recovery points. + IndividualNodeRecoveryPoints []*string +} + +// GetClusterUnplannedFailoverProviderSpecificInput implements the ClusterUnplannedFailoverProviderSpecificInputClassification +// interface for type A2AClusterUnplannedFailoverInput. +func (a *A2AClusterUnplannedFailoverInput) GetClusterUnplannedFailoverProviderSpecificInput() *ClusterUnplannedFailoverProviderSpecificInput { + return &ClusterUnplannedFailoverProviderSpecificInput{ + InstanceType: a.InstanceType, + } +} + // A2AContainerCreationInput - A2A cloud creation input. type A2AContainerCreationInput struct { // REQUIRED; The class type. @@ -275,6 +349,9 @@ type A2AEnableProtectionInput struct { // The multi vm group name. MultiVMGroupName *string + // The replication protection cluster Id. + ProtectionClusterID *string + // The recovery availability set Id. RecoveryAvailabilitySetID *string @@ -530,6 +607,39 @@ type A2AProtectedDiskDetails struct { TfoDiskName *string } +// A2AProtectedItemDetail - A2A specific switch cluster protection input. +type A2AProtectedItemDetail struct { + // The recovery disk encryption information. + DiskEncryptionInfo *DiskEncryptionInfo + + // The recovery availability set. + RecoveryAvailabilitySetID *string + + // The recovery availability zone. + RecoveryAvailabilityZone *string + + // The boot diagnostic storage account. + RecoveryBootDiagStorageAccountID *string + + // The recovery capacity reservation group Id. + RecoveryCapacityReservationGroupID *string + + // The recovery proximity placement group Id. + RecoveryProximityPlacementGroupID *string + + // The recovery resource group Id. + RecoveryResourceGroupID *string + + // The virtual machine scale set id. + RecoveryVirtualMachineScaleSetID *string + + // The Replication Protected item name. + ReplicationProtectedItemName *string + + // The list of vm managed disk details. + VMManagedDisks []*A2AVMManagedDiskInputDetails +} + // A2AProtectedManagedDiskDetails - A2A protected managed disk details. type A2AProtectedManagedDiskDetails struct { // The disk level operations list. @@ -744,6 +854,9 @@ type A2AReplicationDetails struct { // The initial recovery extended location. InitialRecoveryExtendedLocation *ExtendedLocation + // A value indicating if the cluster infra is ready or not. + IsClusterInfraReady *bool + // A value indicating whether agent certificate update is required. IsReplicationAgentCertificateUpdateRequired *bool @@ -797,6 +910,9 @@ type A2AReplicationDetails struct { // The list of protected managed disks. ProtectedManagedDisks []*A2AProtectedManagedDiskDetails + // The replication protection cluster Id. + ProtectionClusterID *string + // The recovery availability set. RecoveryAvailabilitySet *string @@ -979,6 +1095,82 @@ func (a *A2AReplicationIntentDetails) GetReplicationProtectionIntentProviderSpec } } +// A2AReplicationProtectionClusterDetails - A2A provider specific settings. +type A2AReplicationProtectionClusterDetails struct { + // REQUIRED; Gets the Instance type. + InstanceType *string + + // The cluster management Id. + ClusterManagementID *string + + // The recovery point Id to which the cluster was failed over. + FailoverRecoveryPointID *string + + // The initial primary extended location. + InitialPrimaryExtendedLocation *ExtendedLocation + + // The initial primary fabric location. + InitialPrimaryFabricLocation *string + + // The initial primary availability zone. + InitialPrimaryZone *string + + // The initial recovery extended location. + InitialRecoveryExtendedLocation *ExtendedLocation + + // The initial recovery fabric location. + InitialRecoveryFabricLocation *string + + // The initial recovery availability zone. + InitialRecoveryZone *string + + // The time (in UTC) when the last RPO value was calculated by Protection Service. + LastRpoCalculatedTime *time.Time + + // An id that survives actions like switch protection which change the backing PE/CPE objects internally.The lifecycle id + // gets carried forward to have a link/continuity in being able to have an Id that + // denotes the "same" protected cluster even though other internal Ids/ARM Id might be changing. + LifecycleID *string + + // Whether Multi VM group is auto created or specified by user. + MultiVMGroupCreateOption *MultiVMGroupCreateOption + + // The multi vm group Id. + MultiVMGroupID *string + + // The multi vm group name. + MultiVMGroupName *string + + // The primary availability zone. + PrimaryAvailabilityZone *string + + // The primary Extended Location. + PrimaryExtendedLocation *ExtendedLocation + + // Primary fabric location. + PrimaryFabricLocation *string + + // The recovery availability zone. + RecoveryAvailabilityZone *string + + // The recovery Extended Location. + RecoveryExtendedLocation *ExtendedLocation + + // The recovery fabric location. + RecoveryFabricLocation *string + + // The last RPO value in seconds. + RpoInSeconds *int64 +} + +// GetReplicationClusterProviderSpecificSettings implements the ReplicationClusterProviderSpecificSettingsClassification interface +// for type A2AReplicationProtectionClusterDetails. +func (a *A2AReplicationProtectionClusterDetails) GetReplicationClusterProviderSpecificSettings() *ReplicationClusterProviderSpecificSettings { + return &ReplicationClusterProviderSpecificSettings{ + InstanceType: a.InstanceType, + } +} + // A2AReprotectInput - Azure specific reprotect input. type A2AReprotectInput struct { // REQUIRED; The class type. @@ -1011,6 +1203,92 @@ func (a *A2AReprotectInput) GetReverseReplicationProviderSpecificInput() *Revers } } +// A2ASharedDiskIRErrorDetails - Extended location of the resource. +type A2ASharedDiskIRErrorDetails struct { + // READ-ONLY; The error code. + ErrorCode *string + + // READ-ONLY; The error code enum. + ErrorCodeEnum *string + + // READ-ONLY; The error message. + ErrorMessage *string + + // READ-ONLY; The possible causes. + PossibleCauses *string + + // READ-ONLY; The recommended action. + RecommendedAction *string +} + +// A2ASharedDiskReplicationDetails - A2A provider specific settings. +type A2ASharedDiskReplicationDetails struct { + // REQUIRED; Gets the Instance type. + InstanceType *string + + // The recovery point id to which the Virtual node was failed over. + FailoverRecoveryPointID *string + + // The time (in UTC) when the last RPO value was calculated by Protection Service. + LastRpoCalculatedTime *time.Time + + // The management Id. + ManagementID *string + + // The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + MonitoringJobType *string + + // The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + MonitoringPercentageCompletion *int32 + + // Primary fabric location. + PrimaryFabricLocation *string + + // The list of protected managed disks. + ProtectedManagedDisks []*A2AProtectedManagedDiskDetails + + // The recovery fabric location. + RecoveryFabricLocation *string + + // The last RPO value in seconds. + RpoInSeconds *int64 + + // The IR Errors. + SharedDiskIRErrors []*A2ASharedDiskIRErrorDetails + + // The list of unprotected disks. + UnprotectedDisks []*A2AUnprotectedDiskDetails +} + +// GetSharedDiskReplicationProviderSpecificSettings implements the SharedDiskReplicationProviderSpecificSettingsClassification +// interface for type A2ASharedDiskReplicationDetails. +func (a *A2ASharedDiskReplicationDetails) GetSharedDiskReplicationProviderSpecificSettings() *SharedDiskReplicationProviderSpecificSettings { + return &SharedDiskReplicationProviderSpecificSettings{ + InstanceType: a.InstanceType, + } +} + +// A2ASwitchClusterProtectionInput - A2A specific switch cluster protection input. +type A2ASwitchClusterProtectionInput struct { + // REQUIRED; Gets the Instance type. + InstanceType *string + + // The Policy Id. + PolicyID *string + ProtectedItemsDetail []*A2AProtectedItemDetail + + // The recovery container Id. + RecoveryContainerID *string +} + +// GetSwitchClusterProtectionProviderSpecificInput implements the SwitchClusterProtectionProviderSpecificInputClassification +// interface for type A2ASwitchClusterProtectionInput. +func (a *A2ASwitchClusterProtectionInput) GetSwitchClusterProtectionProviderSpecificInput() *SwitchClusterProtectionProviderSpecificInput { + return &SwitchClusterProtectionProviderSpecificInput{ + InstanceType: a.InstanceType, + } +} + // A2ASwitchProtectionInput - A2A specific switch protection input. type A2ASwitchProtectionInput struct { // REQUIRED; Gets the Instance type. @@ -1496,6 +1774,36 @@ type ApplianceSpecificDetails struct { // GetApplianceSpecificDetails implements the ApplianceSpecificDetailsClassification interface for type ApplianceSpecificDetails. func (a *ApplianceSpecificDetails) GetApplianceSpecificDetails() *ApplianceSpecificDetails { return a } +// ApplyClusterRecoveryPointInput - Input definition for apply cluster recovery point. +type ApplyClusterRecoveryPointInput struct { + // REQUIRED; The properties to apply cluster recovery point input. + Properties *ApplyClusterRecoveryPointInputProperties +} + +// ApplyClusterRecoveryPointInputProperties - Input definition for apply cluster recovery point properties. +type ApplyClusterRecoveryPointInputProperties struct { + // REQUIRED; The provider specific input for applying cluster recovery point. + ProviderSpecificDetails ApplyClusterRecoveryPointProviderSpecificInputClassification + + // The cluster recovery point id to be passed to failover to a particular recovery point. + ClusterRecoveryPointID *string + + // The list of individual node recovery points. + IndividualNodeRecoveryPoints []*string +} + +// ApplyClusterRecoveryPointProviderSpecificInput - Provider specific input for apply cluster recovery point. +type ApplyClusterRecoveryPointProviderSpecificInput struct { + // REQUIRED; The class type. + InstanceType *string +} + +// GetApplyClusterRecoveryPointProviderSpecificInput implements the ApplyClusterRecoveryPointProviderSpecificInputClassification +// interface for type ApplyClusterRecoveryPointProviderSpecificInput. +func (a *ApplyClusterRecoveryPointProviderSpecificInput) GetApplyClusterRecoveryPointProviderSpecificInput() *ApplyClusterRecoveryPointProviderSpecificInput { + return a +} + // ApplyRecoveryPointInput - Input to apply recovery point. type ApplyRecoveryPointInput struct { // REQUIRED; The input properties to apply recovery point. @@ -1722,6 +2030,207 @@ type AzureVMDiskDetails struct { VhdType *string } +// ClusterFailoverJobDetails - This class represents the details for a failover job of cluster. +type ClusterFailoverJobDetails struct { + // REQUIRED; Gets the type of job details (see JobDetailsTypes enum for possible values). + InstanceType *string + + // The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow + // object details. + AffectedObjectDetails map[string]*string + + // The test VM details. + ProtectedItemDetails []*FailoverReplicationProtectedItemDetails +} + +// GetJobDetails implements the JobDetailsClassification interface for type ClusterFailoverJobDetails. +func (c *ClusterFailoverJobDetails) GetJobDetails() *JobDetails { + return &JobDetails{ + AffectedObjectDetails: c.AffectedObjectDetails, + InstanceType: c.InstanceType, + } +} + +// ClusterProviderSpecificRecoveryPointDetails - Replication provider specific cluster recovery point details. +type ClusterProviderSpecificRecoveryPointDetails struct { + // READ-ONLY; Gets the provider type. + InstanceType *string +} + +// GetClusterProviderSpecificRecoveryPointDetails implements the ClusterProviderSpecificRecoveryPointDetailsClassification +// interface for type ClusterProviderSpecificRecoveryPointDetails. +func (c *ClusterProviderSpecificRecoveryPointDetails) GetClusterProviderSpecificRecoveryPointDetails() *ClusterProviderSpecificRecoveryPointDetails { + return c +} + +// ClusterRecoveryPoint - Recovery point. +type ClusterRecoveryPoint struct { + // The recovery point Id. + ID *string + + // The name of the recovery point. + Name *string + + // The recovery point properties. + Properties *ClusterRecoveryPointProperties + + // The resource type. + Type *string +} + +// ClusterRecoveryPointCollection - Collection of cluster recovery point details. +type ClusterRecoveryPointCollection struct { + // The value of next link. + NextLink *string + + // The cluster recovery point details. + Value []*ClusterRecoveryPoint +} + +// ClusterRecoveryPointProperties - Cluster recovery point properties. +type ClusterRecoveryPointProperties struct { + // The provider specific details for the recovery point. + ProviderSpecificDetails ClusterProviderSpecificRecoveryPointDetailsClassification + + // The recovery point time. + RecoveryPointTime *time.Time + + // The recovery point type. + RecoveryPointType *ClusterRecoveryPointType +} + +// ClusterSwitchProtectionJobDetails - This class represents details for switch cluster protection job. +type ClusterSwitchProtectionJobDetails struct { + // REQUIRED; Gets the type of job details (see JobDetailsTypes enum for possible values). + InstanceType *string + + // The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow + // object details. + AffectedObjectDetails map[string]*string + + // ARM Id of the new replication protection cluster. + NewReplicationProtectionClusterID *string +} + +// GetJobDetails implements the JobDetailsClassification interface for type ClusterSwitchProtectionJobDetails. +func (c *ClusterSwitchProtectionJobDetails) GetJobDetails() *JobDetails { + return &JobDetails{ + AffectedObjectDetails: c.AffectedObjectDetails, + InstanceType: c.InstanceType, + } +} + +// ClusterTestFailoverCleanupInput - Input definition for test failover cleanup for cluster. +type ClusterTestFailoverCleanupInput struct { + // REQUIRED; Test failover cleanup input properties. + Properties *ClusterTestFailoverCleanupInputProperties +} + +// ClusterTestFailoverCleanupInputProperties - Input definition for test failover cleanup input properties. +type ClusterTestFailoverCleanupInputProperties struct { + // Test failover cleanup comments. + Comments *string +} + +// ClusterTestFailoverInput - Input definition for test cluster failover. +type ClusterTestFailoverInput struct { + // REQUIRED; Test failover input properties. + Properties *ClusterTestFailoverInputProperties +} + +// ClusterTestFailoverInputProperties - Input definition for test failover input properties. +type ClusterTestFailoverInputProperties struct { + // Failover direction. + FailoverDirection *FailoverDirection + + // The id of the network to be used for test failover. + NetworkID *string + + // Network type to be used for test failover. + NetworkType *string + + // Provider specific settings. + ProviderSpecificDetails ClusterTestFailoverProviderSpecificInputClassification +} + +// ClusterTestFailoverJobDetails - This class represents the details for a test failover job of cluster. +type ClusterTestFailoverJobDetails struct { + // REQUIRED; Gets the type of job details (see JobDetailsTypes enum for possible values). + InstanceType *string + + // The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow + // object details. + AffectedObjectDetails map[string]*string + + // The test failover comments. + Comments *string + + // The test network friendly name. + NetworkFriendlyName *string + + // The test network name. + NetworkName *string + + // The test network type (see TestFailoverInput enum for possible values). + NetworkType *string + + // The test VM details. + ProtectedItemDetails []*FailoverReplicationProtectedItemDetails + + // The test failover status. + TestFailoverStatus *string +} + +// GetJobDetails implements the JobDetailsClassification interface for type ClusterTestFailoverJobDetails. +func (c *ClusterTestFailoverJobDetails) GetJobDetails() *JobDetails { + return &JobDetails{ + AffectedObjectDetails: c.AffectedObjectDetails, + InstanceType: c.InstanceType, + } +} + +// ClusterTestFailoverProviderSpecificInput - Provider specific test cluster failover input. +type ClusterTestFailoverProviderSpecificInput struct { + // REQUIRED; The class type. + InstanceType *string +} + +// GetClusterTestFailoverProviderSpecificInput implements the ClusterTestFailoverProviderSpecificInputClassification interface +// for type ClusterTestFailoverProviderSpecificInput. +func (c *ClusterTestFailoverProviderSpecificInput) GetClusterTestFailoverProviderSpecificInput() *ClusterTestFailoverProviderSpecificInput { + return c +} + +// ClusterUnplannedFailoverInput - Input definition for unplanned cluster failover. +type ClusterUnplannedFailoverInput struct { + // REQUIRED; Unplanned failover input properties. + Properties *ClusterUnplannedFailoverInputProperties +} + +// ClusterUnplannedFailoverInputProperties - Input definition for unplanned failover input properties. +type ClusterUnplannedFailoverInputProperties struct { + // Failover direction. + FailoverDirection *string + + // Provider specific settings. + ProviderSpecificDetails ClusterUnplannedFailoverProviderSpecificInputClassification + + // Source site operations status. + SourceSiteOperations *string +} + +// ClusterUnplannedFailoverProviderSpecificInput - Provider specific unplanned cluster failover input. +type ClusterUnplannedFailoverProviderSpecificInput struct { + // REQUIRED; The class type. + InstanceType *string +} + +// GetClusterUnplannedFailoverProviderSpecificInput implements the ClusterUnplannedFailoverProviderSpecificInputClassification +// interface for type ClusterUnplannedFailoverProviderSpecificInput. +func (c *ClusterUnplannedFailoverProviderSpecificInput) GetClusterUnplannedFailoverProviderSpecificInput() *ClusterUnplannedFailoverProviderSpecificInput { + return c +} + // ComputeSizeErrorDetails - Represents the error used to indicate why the target compute size is not applicable. type ComputeSizeErrorDetails struct { // The error message. @@ -2864,11 +3373,23 @@ type HyperVReplicaAzureDiskInputDetails struct { // The DiskId. DiskID *string - // The DiskType. + // The target disk size in GB. + DiskSizeInGB *int64 + + // The disk type. DiskType *DiskAccountType + // The number of IOPS allowed for Premium V2 and Ultra disks. + Iops *int64 + // The LogStorageAccountId. LogStorageAccountID *string + + // The logical sector size (in bytes), 512 by default. + SectorSizeInBytes *int32 + + // The total throughput in Mbps for Premium V2 and Ultra disks. + ThroughputInMbps *int64 } // HyperVReplicaAzureEnableProtectionInput - HyperVReplicaAzure specific enable protection input. @@ -2879,7 +3400,7 @@ type HyperVReplicaAzureEnableProtectionInput struct { // The DiskEncryptionSet ARM Id. DiskEncryptionSetID *string - // The DiskType. + // The disk type. DiskType *DiskAccountType // The list of VHD Ids of disks to be protected. @@ -2898,6 +3419,9 @@ type HyperVReplicaAzureEnableProtectionInput struct { // License type. LicenseType *LicenseType + // The license type for Linux VM's. + LinuxLicenseType *LinuxLicenseType + // The storage account to be used for logging during replication. LogStorageAccountID *string @@ -2943,6 +3467,9 @@ type HyperVReplicaAzureEnableProtectionInput struct { // The storage account Id. TargetStorageAccountID *string + // The target VM security profile. + TargetVMSecurityProfile *SecurityProfileProperties + // The target VM size. TargetVMSize *string @@ -2955,6 +3482,9 @@ type HyperVReplicaAzureEnableProtectionInput struct { // A value indicating whether managed disks should be used during replication. UseManagedDisksForReplication *string + // The OS name selected by user. + UserSelectedOSName *string + // The VM Name. VMName *string @@ -3023,11 +3553,26 @@ type HyperVReplicaAzureManagedDiskDetails struct { // The disk Id. DiskID *string + // The target disk size in GB. + DiskSizeInGB *int64 + + // The number of IOPS allowed for Premium V2 and Ultra disks. + Iops *int64 + // The replica disk type. ReplicaDiskType *string + // The logical sector size (in bytes), 512 by default. + SectorSizeInBytes *int32 + // Seed managed disk Id. SeedManagedDiskID *string + + // The disk type. + TargetDiskAccountType *DiskAccountType + + // The total throughput in Mbps for Premium V2 and Ultra disks. + ThroughputInMbps *int64 } // HyperVReplicaAzurePlannedFailoverProviderInput - HyperVReplicaAzure specific planned failover input. @@ -3146,6 +3691,9 @@ type HyperVReplicaAzureReplicationDetails struct { // License Type of the VM to be used. LicenseType *string + // The license type for Linux VM's. + LinuxLicenseType *LinuxLicenseType + // The operating system info. OSDetails *OSDetails @@ -3204,6 +3752,9 @@ type HyperVReplicaAzureReplicationDetails struct { // The target proximity placement group Id. TargetProximityPlacementGroupID *string + // The target VM security profile. + TargetVMSecurityProfile *SecurityProfileProperties + // The target VM tags. TargetVMTags map[string]*string @@ -3325,6 +3876,9 @@ type HyperVReplicaAzureUpdateReplicationProtectedItemInput struct { // The dictionary of disk resource Id to disk encryption set ARM Id. DiskIDToDiskEncryptionMap map[string]*string + // The license type for Linux VM's. + LinuxLicenseType *LinuxLicenseType + // The recovery Azure resource group Id for classic deployment. RecoveryAzureV1ResourceGroupID *string @@ -3352,6 +3906,9 @@ type HyperVReplicaAzureUpdateReplicationProtectedItemInput struct { // A value indicating whether managed disks should be used during failover. UseManagedDisks *string + // The OS name selected by user. + UserSelectedOSName *string + // The list of disk update properties. VMDisks []*UpdateDiskInput } @@ -3907,7 +4464,7 @@ type InMageAzureV2DiskInputDetails struct { // The DiskId. DiskID *string - // The DiskType. + // The disk type. DiskType *DiskAccountType // The LogStorageAccountId. @@ -3922,7 +4479,7 @@ type InMageAzureV2EnableProtectionInput struct { // The DiskEncryptionSet ARM Id. DiskEncryptionSetID *string - // The DiskType. + // The disk type. DiskType *DiskAccountType // The disks to include list. @@ -4873,6 +5430,22 @@ type InMageProtectedDiskDetails struct { TargetDataInMB *float64 } +// InMageRcmAddDisksInput - InMageRcm add disk(s) input. +type InMageRcmAddDisksInput struct { + // REQUIRED; The list of disk details. + Disks []*InMageRcmDiskInput + + // REQUIRED; The class type. + InstanceType *string +} + +// GetAddDisksProviderSpecificInput implements the AddDisksProviderSpecificInputClassification interface for type InMageRcmAddDisksInput. +func (i *InMageRcmAddDisksInput) GetAddDisksProviderSpecificInput() *AddDisksProviderSpecificInput { + return &AddDisksProviderSpecificInput{ + InstanceType: i.InstanceType, + } +} + // InMageRcmAgentUpgradeBlockingErrorDetails - InMageRcm source agent upgrade blocking error details. type InMageRcmAgentUpgradeBlockingErrorDetails struct { // READ-ONLY; The error code. @@ -5015,6 +5588,18 @@ type InMageRcmDiskInput struct { // The DiskEncryptionSet ARM Id. DiskEncryptionSetID *string + + // The target disk size in GB. + DiskSizeInGB *int64 + + // The number of IOPS allowed for Premium V2 and Ultra disks. + Iops *int64 + + // The logical sector size (in bytes), 512 by default. + SectorSizeInBytes *int32 + + // The total throughput in Mbps for Premium V2 and Ultra disks. + ThroughputInMbps *int64 } // InMageRcmDisksDefaultInput - InMageRcm disk input. @@ -5027,6 +5612,18 @@ type InMageRcmDisksDefaultInput struct { // The DiskEncryptionSet ARM Id. DiskEncryptionSetID *string + + // The target disk size in GB. + DiskSizeInGB *int64 + + // The number of IOPS allowed for Premium V2 and Ultra disks. + Iops *int64 + + // The logical sector size (in bytes), 512 by default. + SectorSizeInBytes *int32 + + // The total throughput in Mbps for Premium V2 and Ultra disks. + ThroughputInMbps *int64 } // InMageRcmEnableProtectionInput - InMageRcm specific enable protection input. @@ -5052,12 +5649,21 @@ type InMageRcmEnableProtectionInput struct { // The license type. LicenseType *LicenseType + // The license type for Linux VM's. + LinuxLicenseType *LinuxLicenseType + // The multi VM group name. MultiVMGroupName *string // The run-as account Id. RunAsAccountID *string + // The SQL Server license type. + SQLServerLicenseType *SQLServerLicenseType + + // The tags for the seed managed disks. + SeedManagedDiskTags []*UserCreatedResourceTag + // The target availability set ARM Id. TargetAvailabilitySetID *string @@ -5067,9 +5673,15 @@ type InMageRcmEnableProtectionInput struct { // The target boot diagnostics storage account ARM Id. TargetBootDiagnosticsStorageAccountID *string + // The tags for the target managed disks. + TargetManagedDiskTags []*UserCreatedResourceTag + // The selected target network ARM Id. TargetNetworkID *string + // The tags for the target NICs. + TargetNicTags []*UserCreatedResourceTag + // The target proximity placement group Id. TargetProximityPlacementGroupID *string @@ -5079,14 +5691,23 @@ type InMageRcmEnableProtectionInput struct { // The target VM name. TargetVMName *string + // The target VM security profile. + TargetVMSecurityProfile *SecurityProfileProperties + // The target VM size. TargetVMSize *string + // The target VM tags. + TargetVMTags []*UserCreatedResourceTag + // The selected test network ARM Id. TestNetworkID *string // The selected test subnet name. TestSubnetName *string + + // The OS name selected by user. + UserSelectedOSName *string } // GetEnableProtectionProviderSpecificInput implements the EnableProtectionProviderSpecificInputClassification interface for @@ -5662,6 +6283,9 @@ type InMageRcmNicDetails struct { // The target IP address type. TargetIPAddressType *EthernetAddressType + // The target NIC name. + TargetNicName *string + // Target subnet name. TargetSubnetName *string @@ -5701,6 +6325,9 @@ type InMageRcmNicInput struct { // A value indicating whether this NIC is selected for failover. IsSelectedForFailover *string + // The target NIC name. + TargetNicName *string + // The target static IP address. TargetStaticIPAddress *string @@ -5766,15 +6393,30 @@ func (i *InMageRcmPolicyDetails) GetPolicyProviderSpecificDetails() *PolicyProvi // InMageRcmProtectedDiskDetails - InMageRcm protected disk details. type InMageRcmProtectedDiskDetails struct { + // The custom target Azure disk name. + CustomTargetDiskName *string + + // The target disk size in GB. + DiskSizeInGB *int64 + // The disk type. DiskType *DiskAccountType + // The number of IOPS allowed for Premium V2 and Ultra disks. + Iops *int64 + // The initial replication details. IrDetails *InMageRcmSyncDetails // The resync details. ResyncDetails *InMageRcmSyncDetails + // The logical sector size (in bytes), 512 by default. + SectorSizeInBytes *int32 + + // The total throughput in Mbps for Premium V2 and Ultra disks. + ThroughputInMbps *int64 + // READ-ONLY; The disk capacity in bytes. CapacityInBytes *int64 @@ -5793,6 +6435,9 @@ type InMageRcmProtectedDiskDetails struct { // READ-ONLY; The disk name. DiskName *string + // READ-ONLY; The disk state. + DiskState *DiskState + // READ-ONLY; A value indicating whether initial replication is complete or not. IsInitialReplicationComplete *string @@ -5863,12 +6508,27 @@ type InMageRcmReplicationDetails struct { // License Type of the VM to be used. LicenseType *string + // The license type for Linux VM's. + LinuxLicenseType *LinuxLicenseType + // The mobility agent information. MobilityAgentDetails *InMageRcmMobilityAgentDetails + // The OS name associated with VM. + OSName *string + // The list of protected disks. ProtectedDisks []*InMageRcmProtectedDiskDetails + // The SQL Server license type. + SQLServerLicenseType *string + + // The tags for the seed managed disks. + SeedManagedDiskTags []*UserCreatedResourceTag + + // A value indicating the inplace OS Upgrade version. + SupportedOSVersions []*string + // The target availability set Id. TargetAvailabilitySetID *string @@ -5881,9 +6541,15 @@ type InMageRcmReplicationDetails struct { // The target location. TargetLocation *string + // The tags for the target managed disks. + TargetManagedDiskTags []*UserCreatedResourceTag + // The target network Id. TargetNetworkID *string + // The tags for the target NICs. + TargetNicTags []*UserCreatedResourceTag + // The target proximity placement group Id. TargetProximityPlacementGroupID *string @@ -5893,12 +6559,21 @@ type InMageRcmReplicationDetails struct { // Target VM name. TargetVMName *string + // The target VM security profile. + TargetVMSecurityProfile *SecurityProfileProperties + // The target VM size. TargetVMSize *string + // The target VM tags. + TargetVMTags []*UserCreatedResourceTag + // The test network Id. TestNetworkID *string + // The list of unprotected disks. + UnprotectedDisks []*InMageRcmUnProtectedDiskDetails + // The network details. VMNics []*InMageRcmNicDetails @@ -6081,6 +6756,9 @@ type InMageRcmTestFailoverInput struct { // The test network Id. NetworkID *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 @@ -6094,6 +6772,18 @@ func (i *InMageRcmTestFailoverInput) GetTestFailoverProviderSpecificInput() *Tes } } +// InMageRcmUnProtectedDiskDetails - InMageRcm un-protected disk details. +type InMageRcmUnProtectedDiskDetails struct { + // READ-ONLY; The disk capacity in bytes. + CapacityInBytes *int64 + + // READ-ONLY; The disk Id. + DiskID *string + + // READ-ONLY; The disk name. + DiskName *string +} + // InMageRcmUnplannedFailoverInput - InMageRcm provider specific input for unplanned failover. type InMageRcmUnplannedFailoverInput struct { // REQUIRED; The class type. @@ -6102,6 +6792,9 @@ type InMageRcmUnplannedFailoverInput struct { // REQUIRED; A value indicating whether VM is to be shutdown. PerformShutdown *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 @@ -6158,6 +6851,12 @@ type InMageRcmUpdateReplicationProtectedItemInput struct { // The license type. LicenseType *LicenseType + // The license type for Linux VM's. + LinuxLicenseType *LinuxLicenseType + + // The SQL Server license type. + SQLServerLicenseType *SQLServerLicenseType + // The target availability set ARM Id. TargetAvailabilitySetID *string @@ -6167,9 +6866,15 @@ type InMageRcmUpdateReplicationProtectedItemInput struct { // The target boot diagnostics storage account ARM Id. TargetBootDiagnosticsStorageAccountID *string + // The tags for the target managed disks. + TargetManagedDiskTags []*UserCreatedResourceTag + // The target network ARM Id. TargetNetworkID *string + // The tags for the target NICs. + TargetNicTags []*UserCreatedResourceTag + // The target proximity placement group Id. TargetProximityPlacementGroupID *string @@ -6182,9 +6887,15 @@ type InMageRcmUpdateReplicationProtectedItemInput struct { // The target VM size. TargetVMSize *string + // The target VM tags. + TargetVMTags []*UserCreatedResourceTag + // The test network ARM Id. TestNetworkID *string + // The OS name selected by user. + UserSelectedOSName *string + // The list of NIC details. VMNics []*InMageRcmNicInput } @@ -6777,6 +7488,18 @@ type LogicalNetworkProperties struct { NetworkVirtualizationStatus *string } +// ManagedRunCommandScriptInput - Managed RunCommand script input +type ManagedRunCommandScriptInput struct { + // REQUIRED; The script parameters. + ScriptParameters *string + + // REQUIRED; The script url. + ScriptURL *string + + // REQUIRED; The step name. + StepName *string +} + // ManualActionTaskDetails - This class represents the manual action task details. type ManualActionTaskDetails struct { // REQUIRED; The type of task details. @@ -7256,6 +7979,9 @@ type OSDetails struct { // Product type. ProductType *string + + // The OS name selected by user. + UserSelectedOSName *string } // OSDiskDetails - Details of the OS Disk. @@ -8673,6 +9399,21 @@ func (r *RecoveryVirtualNetworkCustomDetails) GetRecoveryVirtualNetworkCustomDet return r } +// RegisteredClusterNodes - Extended location of the resource. +type RegisteredClusterNodes struct { + // The BIOS ID. + BiosID *string + + // The cluster node name. + ClusterNodeFqdn *string + + // A value indicating whether this represents virtual entity hosting all the shared disks. + IsSharedDiskVirtualNode *bool + + // The machine ID. + MachineID *string +} + // RemoveDisksInput - Input for remove disk(s) operation. type RemoveDisksInput struct { // Remove disk input properties. @@ -8764,6 +9505,18 @@ type ReplicationApplianceProperties struct { ProviderSpecificDetails ApplianceSpecificDetailsClassification } +// ReplicationClusterProviderSpecificSettings - Replication cluster provider specific settings. +type ReplicationClusterProviderSpecificSettings struct { + // REQUIRED; Gets the Instance type. + InstanceType *string +} + +// GetReplicationClusterProviderSpecificSettings implements the ReplicationClusterProviderSpecificSettingsClassification interface +// for type ReplicationClusterProviderSpecificSettings. +func (r *ReplicationClusterProviderSpecificSettings) GetReplicationClusterProviderSpecificSettings() *ReplicationClusterProviderSpecificSettings { + return r +} + // ReplicationEligibilityResults - Replication eligibility results response model. type ReplicationEligibilityResults struct { // READ-ONLY; Gets Unique ARM identifier for this object. @@ -8947,6 +9700,125 @@ type ReplicationProtectedItemProperties struct { TestFailoverStateDescription *string } +// ReplicationProtectionCluster - Replication protection Cluster. +type ReplicationProtectionCluster struct { + // The custom data. + Properties *ReplicationProtectionClusterProperties + + // READ-ONLY; The protection cluster Id. + ID *string + + // READ-ONLY; The name of the protection cluster. + Name *string + + // READ-ONLY; The Type of the object. + Type *string +} + +// ReplicationProtectionClusterCollection - Replication protected item collection. +type ReplicationProtectionClusterCollection struct { + // The value of next link. + NextLink *string + + // The Replication protection cluster details. + Value []*ReplicationProtectionCluster +} + +// ReplicationProtectionClusterProperties - Replication protection cluster custom data details. +type ReplicationProtectionClusterProperties struct { + // The Current active location of the Protection cluster. + ActiveLocation *string + + // The Agent cluster Id. + AgentClusterID *string + + // The allowed operations on the Replication protection cluster. + AllowedOperations []*string + + // A value indicating whether all nodes of the cluster are registered or not. + AreAllClusterNodesRegistered *bool + + // The cluster FQDN. + ClusterFqdn *string + + // The List of cluster Node FQDNs. + ClusterNodeFqdns []*string + + // The List of Protected Item Id's. + ClusterProtectedItemIDs []*string + + // The registered node details. + ClusterRegisteredNodes []*RegisteredClusterNodes + + // The current scenario. + CurrentScenario *CurrentScenarioDetails + + // List of health errors. + HealthErrors []*HealthError + + // The last successful failover time. + LastSuccessfulFailoverTime *time.Time + + // The last successful test failover time. + LastSuccessfulTestFailoverTime *time.Time + + // The name of Policy governing this PE. + PolicyFriendlyName *string + + // The Policy Id. + PolicyID *string + + // The friendly name of the primary fabric. + PrimaryFabricFriendlyName *string + + // The fabric provider of the primary fabric. + PrimaryFabricProvider *string + + // The name of primary protection container friendly name. + PrimaryProtectionContainerFriendlyName *string + + // The type of protection cluster type. + ProtectionClusterType *string + + // The protection status. + ProtectionState *string + + // The protection state description. + ProtectionStateDescription *string + + // The Replication cluster provider custom settings. + ProviderSpecificDetails ReplicationClusterProviderSpecificSettingsClassification + + // The recovery container Id. + RecoveryContainerID *string + + // The friendly name of recovery fabric. + RecoveryFabricFriendlyName *string + + // The Arm Id of recovery fabric. + RecoveryFabricID *string + + // The name of recovery container friendly name. + RecoveryProtectionContainerFriendlyName *string + + // The consolidated protection health for the VM taking any issues with SRS as well as all the replication units associated + // with the VM's replication group into account. This is a string representation + // of the ProtectionHealth enumeration. + ReplicationHealth *string + + // The shared disk properties. + SharedDiskProperties *SharedDiskReplicationItemProperties + + // The Test failover state. + TestFailoverState *string + + // The Test failover state description. + TestFailoverStateDescription *string + + // READ-ONLY; The provisioning state of the cluster. + ProvisioningState *string +} + // ReplicationProtectionIntent - Replication protection intent. type ReplicationProtectionIntent struct { // Resource Location @@ -9268,6 +10140,24 @@ func (s *ScriptActionTaskDetails) GetTaskTypeDetails() *TaskTypeDetails { } } +// SecurityProfileProperties - Security profile input. +type SecurityProfileProperties struct { + // A value indicating whether confidential compute encryption to be enabled. + TargetVMConfidentialEncryption *SecurityConfiguration + + // A value indicating whether integrity monitoring to be enabled. + TargetVMMonitoring *SecurityConfiguration + + // A value indicating whether secure boot to be enabled. + TargetVMSecureBoot *SecurityConfiguration + + // The target VM security type. + TargetVMSecurityType *SecurityType + + // A value indicating whether trusted platform module to be enabled. + TargetVMTpm *SecurityConfiguration +} + // ServiceError - ASR error model. type ServiceError struct { // Activity Id. @@ -9286,6 +10176,47 @@ type ServiceError struct { RecommendedAction *string } +// SharedDiskReplicationItemProperties - Shared Disk Replication item custom data details. +type SharedDiskReplicationItemProperties 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 + + // List of health errors. + HealthErrors []*HealthError + + // The protection state of shared disk. + ProtectionState *string + + // The consolidated protection health for the VM taking any issues with SRS as well as all the replication units associated + // with the VM's replication group into account. This is a string representation + // of the ProtectionHealth enumeration. + ReplicationHealth *string + + // The Replication provider custom settings. + SharedDiskProviderSpecificDetails SharedDiskReplicationProviderSpecificSettingsClassification + + // The tfo state of shared disk. + TestFailoverState *string +} + +// SharedDiskReplicationProviderSpecificSettings - Replication provider specific settings. +type SharedDiskReplicationProviderSpecificSettings struct { + // REQUIRED; Gets the Instance type. + InstanceType *string +} + +// GetSharedDiskReplicationProviderSpecificSettings implements the SharedDiskReplicationProviderSpecificSettingsClassification +// interface for type SharedDiskReplicationProviderSpecificSettings. +func (s *SharedDiskReplicationProviderSpecificSettings) GetSharedDiskReplicationProviderSpecificSettings() *SharedDiskReplicationProviderSpecificSettings { + return s +} + // StorageAccountCustomDetails - Storage account custom input. type StorageAccountCustomDetails struct { // REQUIRED; The class type. @@ -9432,6 +10363,33 @@ type SupportedOperatingSystems struct { Type *string } +// SwitchClusterProtectionInput - Switch cluster protection input. +type SwitchClusterProtectionInput struct { + // Switch cluster protection properties. + Properties *SwitchClusterProtectionInputProperties +} + +// SwitchClusterProtectionInputProperties - Switch cluster protection input properties. +type SwitchClusterProtectionInputProperties struct { + // Provider specific switch protection input. + ProviderSpecificDetails SwitchClusterProtectionProviderSpecificInputClassification + + // The unique replication protection cluster name. + ReplicationProtectionClusterName *string +} + +// SwitchClusterProtectionProviderSpecificInput - Provider specific switch cluster protection input. +type SwitchClusterProtectionProviderSpecificInput struct { + // REQUIRED; Gets the Instance type. + InstanceType *string +} + +// GetSwitchClusterProtectionProviderSpecificInput implements the SwitchClusterProtectionProviderSpecificInputClassification +// interface for type SwitchClusterProtectionProviderSpecificInput. +func (s *SwitchClusterProtectionProviderSpecificInput) GetSwitchClusterProtectionProviderSpecificInput() *SwitchClusterProtectionProviderSpecificInput { + return s +} + // SwitchProtectionInput - Switch protection input. type SwitchProtectionInput struct { // Switch protection properties. @@ -9750,8 +10708,17 @@ type UpdateDiskInput struct { // REQUIRED; The disk Id. DiskID *string + // The target disk size in GB. + DiskSizeInGB *int64 + + // The number of IOPS allowed for Premium V2 and Ultra disks. + Iops *int64 + // The target disk name. TargetDiskName *string + + // The total throughput in Mbps for Premium V2 and Ultra disks. + ThroughputInMbps *int64 } // UpdateMigrationItemInput - Update migration item input. @@ -9920,6 +10887,15 @@ type UpdateVCenterRequestProperties struct { RunAsAccountID *string } +// UserCreatedResourceTag - Resource tag input. +type UserCreatedResourceTag struct { + // The tag name. Please read for more information: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources#limitations + TagName *string + + // The tag value. Please read her for more information: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources#limitations + TagValue *string +} + // VCenter - vCenter definition. type VCenter struct { // Resource Location @@ -10173,8 +11149,20 @@ type VMwareCbtDiskInput struct { // The DiskEncryptionSet ARM Id. DiskEncryptionSetID *string + // The target disk size in GB. + DiskSizeInGB *int64 + // The disk type. DiskType *DiskAccountType + + // The number of IOPS allowed for Premium V2 and Ultra disks. + Iops *int64 + + // The logical sector size (in bytes), 512 by default. + SectorSizeInBytes *int32 + + // The total throughput in Mbps for Premium V2 and Ultra disks. + ThroughputInMbps *int64 } // VMwareCbtEnableMigrationInput - VMwareCbt specific enable migration input. @@ -10206,6 +11194,9 @@ type VMwareCbtEnableMigrationInput struct { // License type. LicenseType *LicenseType + // The license type for Linux VM's. + LinuxLicenseType *LinuxLicenseType + // A value indicating whether auto resync is to be done. PerformAutoResync *string @@ -10256,6 +11247,9 @@ type VMwareCbtEnableMigrationInput struct { // The selected test subnet name. TestSubnetName *string + + // The OS name selected by user. + UserSelectedOSName *string } // GetEnableMigrationProviderSpecificInput implements the EnableMigrationProviderSpecificInputClassification interface for @@ -10292,6 +11286,9 @@ type VMwareCbtMigrateInput struct { // A value indicating the inplace OS Upgrade version. OSUpgradeVersion *string + + // The managed run command script input. + PostMigrationSteps []*ManagedRunCommandScriptInput } // GetMigrateProviderSpecificInput implements the MigrateProviderSpecificInputClassification interface for type VMwareCbtMigrateInput. @@ -10312,6 +11309,9 @@ type VMwareCbtMigrationDetails struct { // License Type of the VM to be used. LicenseType *string + // The license type for Linux VM's. + LinuxLicenseType *LinuxLicenseType + // A value indicating whether auto resync is to be done. PerformAutoResync *string @@ -10555,12 +11555,24 @@ func (v *VMwareCbtPolicyCreationInput) GetPolicyProviderSpecificInput() *PolicyP // VMwareCbtProtectedDiskDetails - VMwareCbt protected disk details. type VMwareCbtProtectedDiskDetails struct { + // The target disk size in GB. + DiskSizeInGB *int64 + // The disk type. DiskType *DiskAccountType + // The number of IOPS allowed for Premium V2 and Ultra disks. + Iops *int64 + + // The logical sector size (in bytes), 512 by default. + SectorSizeInBytes *int32 + // The name for the target managed disk. TargetDiskName *string + // The total throughput in Mbps for Premium V2 and Ultra disks. + ThroughputInMbps *int64 + // READ-ONLY; The disk capacity in bytes. CapacityInBytes *int64 @@ -10704,6 +11716,9 @@ type VMwareCbtTestMigrateInput struct { // A value indicating the inplace OS Upgrade version. OSUpgradeVersion *string + // The managed run command script input. + PostMigrationSteps []*ManagedRunCommandScriptInput + // The list of NIC details. VMNics []*VMwareCbtNicInput } @@ -10720,11 +11735,20 @@ type VMwareCbtUpdateDiskInput struct { // REQUIRED; The disk Id. DiskID *string + // The target disk size in GB. + DiskSizeInGB *int64 + + // The number of IOPS allowed for Premium V2 and Ultra disks. + Iops *int64 + // A value indicating whether the disk is the OS disk. IsOSDisk *string // The target disk name. TargetDiskName *string + + // The total throughput in Mbps for Premium V2 and Ultra disks. + ThroughputInMbps *int64 } // VMwareCbtUpdateMigrationItemInput - VMwareCbt specific update migration item input. @@ -10735,6 +11759,9 @@ type VMwareCbtUpdateMigrationItemInput struct { // The license type. LicenseType *LicenseType + // The license type for Linux VM's. + LinuxLicenseType *LinuxLicenseType + // A value indicating whether auto resync is to be done. PerformAutoResync *string @@ -10777,6 +11804,9 @@ type VMwareCbtUpdateMigrationItemInput struct { // The test network ARM Id. TestNetworkID *string + // The OS name selected by user. + UserSelectedOSName *string + // The list of disk update properties. VMDisks []*VMwareCbtUpdateDiskInput diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/models_serde.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/models_serde.go index aa16b13442aa..688df863e63f 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/models_serde.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/models_serde.go @@ -50,6 +50,33 @@ func (a *A2AAddDisksInput) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type A2AApplyClusterRecoveryPointInput. +func (a A2AApplyClusterRecoveryPointInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["instanceType"] = "A2A" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type A2AApplyClusterRecoveryPointInput. +func (a *A2AApplyClusterRecoveryPointInput) 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 "instanceType": + err = unpopulate(val, "InstanceType", &a.InstanceType) + 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 A2AApplyRecoveryPointInput. func (a A2AApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -77,6 +104,111 @@ func (a *A2AApplyRecoveryPointInput) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type A2AClusterRecoveryPointDetails. +func (a A2AClusterRecoveryPointDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["instanceType"] = "A2A" + populate(objectMap, "nodes", a.Nodes) + populate(objectMap, "recoveryPointSyncType", a.RecoveryPointSyncType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type A2AClusterRecoveryPointDetails. +func (a *A2AClusterRecoveryPointDetails) 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 "instanceType": + err = unpopulate(val, "InstanceType", &a.InstanceType) + delete(rawMsg, key) + case "nodes": + err = unpopulate(val, "Nodes", &a.Nodes) + delete(rawMsg, key) + case "recoveryPointSyncType": + err = unpopulate(val, "RecoveryPointSyncType", &a.RecoveryPointSyncType) + 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 A2AClusterTestFailoverInput. +func (a A2AClusterTestFailoverInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clusterRecoveryPointId", a.ClusterRecoveryPointID) + populate(objectMap, "individualNodeRecoveryPoints", a.IndividualNodeRecoveryPoints) + objectMap["instanceType"] = "A2A" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type A2AClusterTestFailoverInput. +func (a *A2AClusterTestFailoverInput) 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 "clusterRecoveryPointId": + err = unpopulate(val, "ClusterRecoveryPointID", &a.ClusterRecoveryPointID) + delete(rawMsg, key) + case "individualNodeRecoveryPoints": + err = unpopulate(val, "IndividualNodeRecoveryPoints", &a.IndividualNodeRecoveryPoints) + delete(rawMsg, key) + case "instanceType": + err = unpopulate(val, "InstanceType", &a.InstanceType) + 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 A2AClusterUnplannedFailoverInput. +func (a A2AClusterUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clusterRecoveryPointId", a.ClusterRecoveryPointID) + populate(objectMap, "individualNodeRecoveryPoints", a.IndividualNodeRecoveryPoints) + objectMap["instanceType"] = "A2A" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type A2AClusterUnplannedFailoverInput. +func (a *A2AClusterUnplannedFailoverInput) 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 "clusterRecoveryPointId": + err = unpopulate(val, "ClusterRecoveryPointID", &a.ClusterRecoveryPointID) + delete(rawMsg, key) + case "individualNodeRecoveryPoints": + err = unpopulate(val, "IndividualNodeRecoveryPoints", &a.IndividualNodeRecoveryPoints) + delete(rawMsg, key) + case "instanceType": + err = unpopulate(val, "InstanceType", &a.InstanceType) + 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 A2AContainerCreationInput. func (a A2AContainerCreationInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -434,6 +566,7 @@ func (a A2AEnableProtectionInput) MarshalJSON() ([]byte, error) { objectMap["instanceType"] = "A2A" populate(objectMap, "multiVmGroupId", a.MultiVMGroupID) populate(objectMap, "multiVmGroupName", a.MultiVMGroupName) + populate(objectMap, "protectionClusterId", a.ProtectionClusterID) populate(objectMap, "recoveryAvailabilitySetId", a.RecoveryAvailabilitySetID) populate(objectMap, "recoveryAvailabilityZone", a.RecoveryAvailabilityZone) populate(objectMap, "recoveryAzureNetworkId", a.RecoveryAzureNetworkID) @@ -478,6 +611,9 @@ func (a *A2AEnableProtectionInput) UnmarshalJSON(data []byte) error { case "multiVmGroupName": err = unpopulate(val, "MultiVMGroupName", &a.MultiVMGroupName) delete(rawMsg, key) + case "protectionClusterId": + err = unpopulate(val, "ProtectionClusterID", &a.ProtectionClusterID) + delete(rawMsg, key) case "recoveryAvailabilitySetId": err = unpopulate(val, "RecoveryAvailabilitySetID", &a.RecoveryAvailabilitySetID) delete(rawMsg, key) @@ -886,6 +1022,69 @@ func (a *A2AProtectedDiskDetails) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type A2AProtectedItemDetail. +func (a A2AProtectedItemDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "diskEncryptionInfo", a.DiskEncryptionInfo) + populate(objectMap, "recoveryAvailabilitySetId", a.RecoveryAvailabilitySetID) + populate(objectMap, "recoveryAvailabilityZone", a.RecoveryAvailabilityZone) + populate(objectMap, "recoveryBootDiagStorageAccountId", a.RecoveryBootDiagStorageAccountID) + populate(objectMap, "recoveryCapacityReservationGroupId", a.RecoveryCapacityReservationGroupID) + populate(objectMap, "recoveryProximityPlacementGroupId", a.RecoveryProximityPlacementGroupID) + populate(objectMap, "recoveryResourceGroupId", a.RecoveryResourceGroupID) + populate(objectMap, "recoveryVirtualMachineScaleSetId", a.RecoveryVirtualMachineScaleSetID) + populate(objectMap, "replicationProtectedItemName", a.ReplicationProtectedItemName) + populate(objectMap, "vmManagedDisks", a.VMManagedDisks) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type A2AProtectedItemDetail. +func (a *A2AProtectedItemDetail) 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 "diskEncryptionInfo": + err = unpopulate(val, "DiskEncryptionInfo", &a.DiskEncryptionInfo) + delete(rawMsg, key) + case "recoveryAvailabilitySetId": + err = unpopulate(val, "RecoveryAvailabilitySetID", &a.RecoveryAvailabilitySetID) + delete(rawMsg, key) + case "recoveryAvailabilityZone": + err = unpopulate(val, "RecoveryAvailabilityZone", &a.RecoveryAvailabilityZone) + delete(rawMsg, key) + case "recoveryBootDiagStorageAccountId": + err = unpopulate(val, "RecoveryBootDiagStorageAccountID", &a.RecoveryBootDiagStorageAccountID) + delete(rawMsg, key) + case "recoveryCapacityReservationGroupId": + err = unpopulate(val, "RecoveryCapacityReservationGroupID", &a.RecoveryCapacityReservationGroupID) + delete(rawMsg, key) + case "recoveryProximityPlacementGroupId": + err = unpopulate(val, "RecoveryProximityPlacementGroupID", &a.RecoveryProximityPlacementGroupID) + delete(rawMsg, key) + case "recoveryResourceGroupId": + err = unpopulate(val, "RecoveryResourceGroupID", &a.RecoveryResourceGroupID) + delete(rawMsg, key) + case "recoveryVirtualMachineScaleSetId": + err = unpopulate(val, "RecoveryVirtualMachineScaleSetID", &a.RecoveryVirtualMachineScaleSetID) + delete(rawMsg, key) + case "replicationProtectedItemName": + err = unpopulate(val, "ReplicationProtectedItemName", &a.ReplicationProtectedItemName) + delete(rawMsg, key) + case "vmManagedDisks": + err = unpopulate(val, "VMManagedDisks", &a.VMManagedDisks) + 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 A2AProtectedManagedDiskDetails. func (a A2AProtectedManagedDiskDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1240,6 +1439,7 @@ func (a A2AReplicationDetails) MarshalJSON() ([]byte, error) { populate(objectMap, "initialRecoveryFabricLocation", a.InitialRecoveryFabricLocation) populate(objectMap, "initialRecoveryZone", a.InitialRecoveryZone) objectMap["instanceType"] = "A2A" + populate(objectMap, "isClusterInfraReady", a.IsClusterInfraReady) populate(objectMap, "isReplicationAgentCertificateUpdateRequired", a.IsReplicationAgentCertificateUpdateRequired) populate(objectMap, "isReplicationAgentUpdateRequired", a.IsReplicationAgentUpdateRequired) populateDateTimeRFC3339(objectMap, "lastHeartbeat", a.LastHeartbeat) @@ -1257,6 +1457,7 @@ func (a A2AReplicationDetails) MarshalJSON() ([]byte, error) { populate(objectMap, "primaryFabricLocation", a.PrimaryFabricLocation) populate(objectMap, "protectedDisks", a.ProtectedDisks) populate(objectMap, "protectedManagedDisks", a.ProtectedManagedDisks) + populate(objectMap, "protectionClusterId", a.ProtectionClusterID) populate(objectMap, "recoveryAvailabilitySet", a.RecoveryAvailabilitySet) populate(objectMap, "recoveryAvailabilityZone", a.RecoveryAvailabilityZone) populate(objectMap, "recoveryAzureGeneration", a.RecoveryAzureGeneration) @@ -1333,6 +1534,9 @@ func (a *A2AReplicationDetails) UnmarshalJSON(data []byte) error { case "instanceType": err = unpopulate(val, "InstanceType", &a.InstanceType) delete(rawMsg, key) + case "isClusterInfraReady": + err = unpopulate(val, "IsClusterInfraReady", &a.IsClusterInfraReady) + delete(rawMsg, key) case "isReplicationAgentCertificateUpdateRequired": err = unpopulate(val, "IsReplicationAgentCertificateUpdateRequired", &a.IsReplicationAgentCertificateUpdateRequired) delete(rawMsg, key) @@ -1384,6 +1588,9 @@ func (a *A2AReplicationDetails) UnmarshalJSON(data []byte) error { case "protectedManagedDisks": err = unpopulate(val, "ProtectedManagedDisks", &a.ProtectedManagedDisks) delete(rawMsg, key) + case "protectionClusterId": + err = unpopulate(val, "ProtectionClusterID", &a.ProtectionClusterID) + delete(rawMsg, key) case "recoveryAvailabilitySet": err = unpopulate(val, "RecoveryAvailabilitySet", &a.RecoveryAvailabilitySet) delete(rawMsg, key) @@ -1582,21 +1789,35 @@ func (a *A2AReplicationIntentDetails) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type A2AReprotectInput. -func (a A2AReprotectInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type A2AReplicationProtectionClusterDetails. +func (a A2AReplicationProtectionClusterDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "clusterManagementId", a.ClusterManagementID) + populate(objectMap, "failoverRecoveryPointId", a.FailoverRecoveryPointID) + 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) objectMap["instanceType"] = "A2A" - populate(objectMap, "policyId", a.PolicyID) - populate(objectMap, "recoveryAvailabilitySetId", a.RecoveryAvailabilitySetID) - populate(objectMap, "recoveryCloudServiceId", a.RecoveryCloudServiceID) - populate(objectMap, "recoveryContainerId", a.RecoveryContainerID) - populate(objectMap, "recoveryResourceGroupId", a.RecoveryResourceGroupID) - populate(objectMap, "vmDisks", a.VMDisks) + populateDateTimeRFC3339(objectMap, "lastRpoCalculatedTime", a.LastRpoCalculatedTime) + populate(objectMap, "lifecycleId", a.LifecycleID) + populate(objectMap, "multiVmGroupCreateOption", a.MultiVMGroupCreateOption) + populate(objectMap, "multiVmGroupId", a.MultiVMGroupID) + populate(objectMap, "multiVmGroupName", a.MultiVMGroupName) + populate(objectMap, "primaryAvailabilityZone", a.PrimaryAvailabilityZone) + populate(objectMap, "primaryExtendedLocation", a.PrimaryExtendedLocation) + populate(objectMap, "primaryFabricLocation", a.PrimaryFabricLocation) + populate(objectMap, "recoveryAvailabilityZone", a.RecoveryAvailabilityZone) + populate(objectMap, "recoveryExtendedLocation", a.RecoveryExtendedLocation) + populate(objectMap, "recoveryFabricLocation", a.RecoveryFabricLocation) + populate(objectMap, "rpoInSeconds", a.RpoInSeconds) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type A2AReprotectInput. -func (a *A2AReprotectInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type A2AReplicationProtectionClusterDetails. +func (a *A2AReplicationProtectionClusterDetails) 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) @@ -1604,26 +1825,68 @@ func (a *A2AReprotectInput) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "clusterManagementId": + err = unpopulate(val, "ClusterManagementID", &a.ClusterManagementID) + delete(rawMsg, key) + case "failoverRecoveryPointId": + err = unpopulate(val, "FailoverRecoveryPointID", &a.FailoverRecoveryPointID) + delete(rawMsg, 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 "instanceType": err = unpopulate(val, "InstanceType", &a.InstanceType) delete(rawMsg, key) - case "policyId": - err = unpopulate(val, "PolicyID", &a.PolicyID) + case "lastRpoCalculatedTime": + err = unpopulateDateTimeRFC3339(val, "LastRpoCalculatedTime", &a.LastRpoCalculatedTime) delete(rawMsg, key) - case "recoveryAvailabilitySetId": - err = unpopulate(val, "RecoveryAvailabilitySetID", &a.RecoveryAvailabilitySetID) + case "lifecycleId": + err = unpopulate(val, "LifecycleID", &a.LifecycleID) delete(rawMsg, key) - case "recoveryCloudServiceId": - err = unpopulate(val, "RecoveryCloudServiceID", &a.RecoveryCloudServiceID) + case "multiVmGroupCreateOption": + err = unpopulate(val, "MultiVMGroupCreateOption", &a.MultiVMGroupCreateOption) delete(rawMsg, key) - case "recoveryContainerId": - err = unpopulate(val, "RecoveryContainerID", &a.RecoveryContainerID) + case "multiVmGroupId": + err = unpopulate(val, "MultiVMGroupID", &a.MultiVMGroupID) delete(rawMsg, key) - case "recoveryResourceGroupId": - err = unpopulate(val, "RecoveryResourceGroupID", &a.RecoveryResourceGroupID) + case "multiVmGroupName": + err = unpopulate(val, "MultiVMGroupName", &a.MultiVMGroupName) delete(rawMsg, key) - case "vmDisks": - err = unpopulate(val, "VMDisks", &a.VMDisks) + case "primaryAvailabilityZone": + err = unpopulate(val, "PrimaryAvailabilityZone", &a.PrimaryAvailabilityZone) + 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 "recoveryAvailabilityZone": + err = unpopulate(val, "RecoveryAvailabilityZone", &a.RecoveryAvailabilityZone) + 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 "rpoInSeconds": + err = unpopulate(val, "RpoInSeconds", &a.RpoInSeconds) delete(rawMsg, key) } if err != nil { @@ -1633,8 +1896,212 @@ func (a *A2AReprotectInput) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type A2ASwitchProtectionInput. -func (a A2ASwitchProtectionInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type A2AReprotectInput. +func (a A2AReprotectInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["instanceType"] = "A2A" + populate(objectMap, "policyId", a.PolicyID) + populate(objectMap, "recoveryAvailabilitySetId", a.RecoveryAvailabilitySetID) + populate(objectMap, "recoveryCloudServiceId", a.RecoveryCloudServiceID) + populate(objectMap, "recoveryContainerId", a.RecoveryContainerID) + populate(objectMap, "recoveryResourceGroupId", a.RecoveryResourceGroupID) + populate(objectMap, "vmDisks", a.VMDisks) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type A2AReprotectInput. +func (a *A2AReprotectInput) 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 "instanceType": + err = unpopulate(val, "InstanceType", &a.InstanceType) + delete(rawMsg, key) + case "policyId": + err = unpopulate(val, "PolicyID", &a.PolicyID) + delete(rawMsg, key) + case "recoveryAvailabilitySetId": + err = unpopulate(val, "RecoveryAvailabilitySetID", &a.RecoveryAvailabilitySetID) + delete(rawMsg, key) + case "recoveryCloudServiceId": + err = unpopulate(val, "RecoveryCloudServiceID", &a.RecoveryCloudServiceID) + delete(rawMsg, key) + case "recoveryContainerId": + err = unpopulate(val, "RecoveryContainerID", &a.RecoveryContainerID) + delete(rawMsg, key) + case "recoveryResourceGroupId": + err = unpopulate(val, "RecoveryResourceGroupID", &a.RecoveryResourceGroupID) + delete(rawMsg, key) + case "vmDisks": + err = unpopulate(val, "VMDisks", &a.VMDisks) + 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 A2ASharedDiskIRErrorDetails. +func (a A2ASharedDiskIRErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "errorCode", a.ErrorCode) + populate(objectMap, "errorCodeEnum", a.ErrorCodeEnum) + populate(objectMap, "errorMessage", a.ErrorMessage) + populate(objectMap, "possibleCauses", a.PossibleCauses) + populate(objectMap, "recommendedAction", a.RecommendedAction) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type A2ASharedDiskIRErrorDetails. +func (a *A2ASharedDiskIRErrorDetails) 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 "errorCode": + err = unpopulate(val, "ErrorCode", &a.ErrorCode) + delete(rawMsg, key) + case "errorCodeEnum": + err = unpopulate(val, "ErrorCodeEnum", &a.ErrorCodeEnum) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &a.ErrorMessage) + delete(rawMsg, key) + case "possibleCauses": + err = unpopulate(val, "PossibleCauses", &a.PossibleCauses) + delete(rawMsg, key) + case "recommendedAction": + err = unpopulate(val, "RecommendedAction", &a.RecommendedAction) + 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 A2ASharedDiskReplicationDetails. +func (a A2ASharedDiskReplicationDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "failoverRecoveryPointId", a.FailoverRecoveryPointID) + objectMap["instanceType"] = "A2A" + populateDateTimeRFC3339(objectMap, "lastRpoCalculatedTime", a.LastRpoCalculatedTime) + populate(objectMap, "managementId", a.ManagementID) + populate(objectMap, "monitoringJobType", a.MonitoringJobType) + populate(objectMap, "monitoringPercentageCompletion", a.MonitoringPercentageCompletion) + populate(objectMap, "primaryFabricLocation", a.PrimaryFabricLocation) + populate(objectMap, "protectedManagedDisks", a.ProtectedManagedDisks) + populate(objectMap, "recoveryFabricLocation", a.RecoveryFabricLocation) + populate(objectMap, "rpoInSeconds", a.RpoInSeconds) + populate(objectMap, "sharedDiskIRErrors", a.SharedDiskIRErrors) + populate(objectMap, "unprotectedDisks", a.UnprotectedDisks) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type A2ASharedDiskReplicationDetails. +func (a *A2ASharedDiskReplicationDetails) 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 "failoverRecoveryPointId": + err = unpopulate(val, "FailoverRecoveryPointID", &a.FailoverRecoveryPointID) + delete(rawMsg, key) + case "instanceType": + err = unpopulate(val, "InstanceType", &a.InstanceType) + delete(rawMsg, key) + case "lastRpoCalculatedTime": + err = unpopulateDateTimeRFC3339(val, "LastRpoCalculatedTime", &a.LastRpoCalculatedTime) + delete(rawMsg, key) + case "managementId": + err = unpopulate(val, "ManagementID", &a.ManagementID) + delete(rawMsg, key) + case "monitoringJobType": + err = unpopulate(val, "MonitoringJobType", &a.MonitoringJobType) + delete(rawMsg, key) + case "monitoringPercentageCompletion": + err = unpopulate(val, "MonitoringPercentageCompletion", &a.MonitoringPercentageCompletion) + delete(rawMsg, key) + case "primaryFabricLocation": + err = unpopulate(val, "PrimaryFabricLocation", &a.PrimaryFabricLocation) + delete(rawMsg, key) + case "protectedManagedDisks": + err = unpopulate(val, "ProtectedManagedDisks", &a.ProtectedManagedDisks) + delete(rawMsg, key) + case "recoveryFabricLocation": + err = unpopulate(val, "RecoveryFabricLocation", &a.RecoveryFabricLocation) + delete(rawMsg, key) + case "rpoInSeconds": + err = unpopulate(val, "RpoInSeconds", &a.RpoInSeconds) + delete(rawMsg, key) + case "sharedDiskIRErrors": + err = unpopulate(val, "SharedDiskIRErrors", &a.SharedDiskIRErrors) + delete(rawMsg, key) + case "unprotectedDisks": + err = unpopulate(val, "UnprotectedDisks", &a.UnprotectedDisks) + 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 A2ASwitchClusterProtectionInput. +func (a A2ASwitchClusterProtectionInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["instanceType"] = "A2A" + populate(objectMap, "policyId", a.PolicyID) + populate(objectMap, "protectedItemsDetail", a.ProtectedItemsDetail) + populate(objectMap, "recoveryContainerId", a.RecoveryContainerID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type A2ASwitchClusterProtectionInput. +func (a *A2ASwitchClusterProtectionInput) 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 "instanceType": + err = unpopulate(val, "InstanceType", &a.InstanceType) + delete(rawMsg, key) + case "policyId": + err = unpopulate(val, "PolicyID", &a.PolicyID) + delete(rawMsg, key) + case "protectedItemsDetail": + err = unpopulate(val, "ProtectedItemsDetail", &a.ProtectedItemsDetail) + delete(rawMsg, key) + case "recoveryContainerId": + err = unpopulate(val, "RecoveryContainerID", &a.RecoveryContainerID) + 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 A2ASwitchProtectionInput. +func (a A2ASwitchProtectionInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "diskEncryptionInfo", a.DiskEncryptionInfo) objectMap["instanceType"] = "A2A" @@ -2741,6 +3208,95 @@ func (a *ApplianceSpecificDetails) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ApplyClusterRecoveryPointInput. +func (a ApplyClusterRecoveryPointInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplyClusterRecoveryPointInput. +func (a *ApplyClusterRecoveryPointInput) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 ApplyClusterRecoveryPointInputProperties. +func (a ApplyClusterRecoveryPointInputProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clusterRecoveryPointId", a.ClusterRecoveryPointID) + populate(objectMap, "individualNodeRecoveryPoints", a.IndividualNodeRecoveryPoints) + populate(objectMap, "providerSpecificDetails", a.ProviderSpecificDetails) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplyClusterRecoveryPointInputProperties. +func (a *ApplyClusterRecoveryPointInputProperties) 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 "clusterRecoveryPointId": + err = unpopulate(val, "ClusterRecoveryPointID", &a.ClusterRecoveryPointID) + delete(rawMsg, key) + case "individualNodeRecoveryPoints": + err = unpopulate(val, "IndividualNodeRecoveryPoints", &a.IndividualNodeRecoveryPoints) + delete(rawMsg, key) + case "providerSpecificDetails": + a.ProviderSpecificDetails, err = unmarshalApplyClusterRecoveryPointProviderSpecificInputClassification(val) + 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 ApplyClusterRecoveryPointProviderSpecificInput. +func (a ApplyClusterRecoveryPointProviderSpecificInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["instanceType"] = a.InstanceType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplyClusterRecoveryPointProviderSpecificInput. +func (a *ApplyClusterRecoveryPointProviderSpecificInput) 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 "instanceType": + err = unpopulate(val, "InstanceType", &a.InstanceType) + 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 ApplyRecoveryPointInput. func (a ApplyRecoveryPointInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3189,16 +3745,17 @@ func (a *AzureVMDiskDetails) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ComputeSizeErrorDetails. -func (c ComputeSizeErrorDetails) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClusterFailoverJobDetails. +func (c ClusterFailoverJobDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "message", c.Message) - populate(objectMap, "severity", c.Severity) + populate(objectMap, "affectedObjectDetails", c.AffectedObjectDetails) + objectMap["instanceType"] = "ClusterFailoverJobDetails" + populate(objectMap, "protectedItemDetails", c.ProtectedItemDetails) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeSizeErrorDetails. -func (c *ComputeSizeErrorDetails) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterFailoverJobDetails. +func (c *ClusterFailoverJobDetails) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3206,11 +3763,503 @@ func (c *ComputeSizeErrorDetails) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "message": - err = unpopulate(val, "Message", &c.Message) + case "affectedObjectDetails": + err = unpopulate(val, "AffectedObjectDetails", &c.AffectedObjectDetails) delete(rawMsg, key) - case "severity": - err = unpopulate(val, "Severity", &c.Severity) + case "instanceType": + err = unpopulate(val, "InstanceType", &c.InstanceType) + delete(rawMsg, key) + case "protectedItemDetails": + err = unpopulate(val, "ProtectedItemDetails", &c.ProtectedItemDetails) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterProviderSpecificRecoveryPointDetails. +func (c ClusterProviderSpecificRecoveryPointDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["instanceType"] = c.InstanceType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterProviderSpecificRecoveryPointDetails. +func (c *ClusterProviderSpecificRecoveryPointDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "instanceType": + err = unpopulate(val, "InstanceType", &c.InstanceType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterRecoveryPoint. +func (c ClusterRecoveryPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterRecoveryPoint. +func (c *ClusterRecoveryPoint) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterRecoveryPointCollection. +func (c ClusterRecoveryPointCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterRecoveryPointCollection. +func (c *ClusterRecoveryPointCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterRecoveryPointProperties. +func (c ClusterRecoveryPointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "providerSpecificDetails", c.ProviderSpecificDetails) + populateDateTimeRFC3339(objectMap, "recoveryPointTime", c.RecoveryPointTime) + populate(objectMap, "recoveryPointType", c.RecoveryPointType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterRecoveryPointProperties. +func (c *ClusterRecoveryPointProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "providerSpecificDetails": + c.ProviderSpecificDetails, err = unmarshalClusterProviderSpecificRecoveryPointDetailsClassification(val) + delete(rawMsg, key) + case "recoveryPointTime": + err = unpopulateDateTimeRFC3339(val, "RecoveryPointTime", &c.RecoveryPointTime) + delete(rawMsg, key) + case "recoveryPointType": + err = unpopulate(val, "RecoveryPointType", &c.RecoveryPointType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterSwitchProtectionJobDetails. +func (c ClusterSwitchProtectionJobDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "affectedObjectDetails", c.AffectedObjectDetails) + objectMap["instanceType"] = "ClusterSwitchProtectionJobDetails" + populate(objectMap, "newReplicationProtectionClusterId", c.NewReplicationProtectionClusterID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterSwitchProtectionJobDetails. +func (c *ClusterSwitchProtectionJobDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "affectedObjectDetails": + err = unpopulate(val, "AffectedObjectDetails", &c.AffectedObjectDetails) + delete(rawMsg, key) + case "instanceType": + err = unpopulate(val, "InstanceType", &c.InstanceType) + delete(rawMsg, key) + case "newReplicationProtectionClusterId": + err = unpopulate(val, "NewReplicationProtectionClusterID", &c.NewReplicationProtectionClusterID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterTestFailoverCleanupInput. +func (c ClusterTestFailoverCleanupInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterTestFailoverCleanupInput. +func (c *ClusterTestFailoverCleanupInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterTestFailoverCleanupInputProperties. +func (c ClusterTestFailoverCleanupInputProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "comments", c.Comments) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterTestFailoverCleanupInputProperties. +func (c *ClusterTestFailoverCleanupInputProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "comments": + err = unpopulate(val, "Comments", &c.Comments) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterTestFailoverInput. +func (c ClusterTestFailoverInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterTestFailoverInput. +func (c *ClusterTestFailoverInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterTestFailoverInputProperties. +func (c ClusterTestFailoverInputProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "failoverDirection", c.FailoverDirection) + populate(objectMap, "networkId", c.NetworkID) + populate(objectMap, "networkType", c.NetworkType) + populate(objectMap, "providerSpecificDetails", c.ProviderSpecificDetails) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterTestFailoverInputProperties. +func (c *ClusterTestFailoverInputProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "failoverDirection": + err = unpopulate(val, "FailoverDirection", &c.FailoverDirection) + delete(rawMsg, key) + case "networkId": + err = unpopulate(val, "NetworkID", &c.NetworkID) + delete(rawMsg, key) + case "networkType": + err = unpopulate(val, "NetworkType", &c.NetworkType) + delete(rawMsg, key) + case "providerSpecificDetails": + c.ProviderSpecificDetails, err = unmarshalClusterTestFailoverProviderSpecificInputClassification(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterTestFailoverJobDetails. +func (c ClusterTestFailoverJobDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "affectedObjectDetails", c.AffectedObjectDetails) + populate(objectMap, "comments", c.Comments) + objectMap["instanceType"] = "ClusterTestFailoverJobDetails" + populate(objectMap, "networkFriendlyName", c.NetworkFriendlyName) + populate(objectMap, "networkName", c.NetworkName) + populate(objectMap, "networkType", c.NetworkType) + populate(objectMap, "protectedItemDetails", c.ProtectedItemDetails) + populate(objectMap, "testFailoverStatus", c.TestFailoverStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterTestFailoverJobDetails. +func (c *ClusterTestFailoverJobDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "affectedObjectDetails": + err = unpopulate(val, "AffectedObjectDetails", &c.AffectedObjectDetails) + delete(rawMsg, key) + case "comments": + err = unpopulate(val, "Comments", &c.Comments) + delete(rawMsg, key) + case "instanceType": + err = unpopulate(val, "InstanceType", &c.InstanceType) + delete(rawMsg, key) + case "networkFriendlyName": + err = unpopulate(val, "NetworkFriendlyName", &c.NetworkFriendlyName) + delete(rawMsg, key) + case "networkName": + err = unpopulate(val, "NetworkName", &c.NetworkName) + delete(rawMsg, key) + case "networkType": + err = unpopulate(val, "NetworkType", &c.NetworkType) + delete(rawMsg, key) + case "protectedItemDetails": + err = unpopulate(val, "ProtectedItemDetails", &c.ProtectedItemDetails) + delete(rawMsg, key) + case "testFailoverStatus": + err = unpopulate(val, "TestFailoverStatus", &c.TestFailoverStatus) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterTestFailoverProviderSpecificInput. +func (c ClusterTestFailoverProviderSpecificInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["instanceType"] = c.InstanceType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterTestFailoverProviderSpecificInput. +func (c *ClusterTestFailoverProviderSpecificInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "instanceType": + err = unpopulate(val, "InstanceType", &c.InstanceType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterUnplannedFailoverInput. +func (c ClusterUnplannedFailoverInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterUnplannedFailoverInput. +func (c *ClusterUnplannedFailoverInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterUnplannedFailoverInputProperties. +func (c ClusterUnplannedFailoverInputProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "failoverDirection", c.FailoverDirection) + populate(objectMap, "providerSpecificDetails", c.ProviderSpecificDetails) + populate(objectMap, "sourceSiteOperations", c.SourceSiteOperations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterUnplannedFailoverInputProperties. +func (c *ClusterUnplannedFailoverInputProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "failoverDirection": + err = unpopulate(val, "FailoverDirection", &c.FailoverDirection) + delete(rawMsg, key) + case "providerSpecificDetails": + c.ProviderSpecificDetails, err = unmarshalClusterUnplannedFailoverProviderSpecificInputClassification(val) + delete(rawMsg, key) + case "sourceSiteOperations": + err = unpopulate(val, "SourceSiteOperations", &c.SourceSiteOperations) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterUnplannedFailoverProviderSpecificInput. +func (c ClusterUnplannedFailoverProviderSpecificInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["instanceType"] = c.InstanceType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterUnplannedFailoverProviderSpecificInput. +func (c *ClusterUnplannedFailoverProviderSpecificInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "instanceType": + err = unpopulate(val, "InstanceType", &c.InstanceType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComputeSizeErrorDetails. +func (c ComputeSizeErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "message", c.Message) + populate(objectMap, "severity", c.Severity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeSizeErrorDetails. +func (c *ComputeSizeErrorDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "message": + err = unpopulate(val, "Message", &c.Message) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &c.Severity) delete(rawMsg, key) } if err != nil { @@ -5936,8 +6985,12 @@ func (h HyperVReplicaAzureDiskInputDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "diskEncryptionSetId", h.DiskEncryptionSetID) populate(objectMap, "diskId", h.DiskID) + populate(objectMap, "diskSizeInGB", h.DiskSizeInGB) populate(objectMap, "diskType", h.DiskType) + populate(objectMap, "iops", h.Iops) populate(objectMap, "logStorageAccountId", h.LogStorageAccountID) + populate(objectMap, "sectorSizeInBytes", h.SectorSizeInBytes) + populate(objectMap, "throughputInMbps", h.ThroughputInMbps) return json.Marshal(objectMap) } @@ -5956,12 +7009,24 @@ func (h *HyperVReplicaAzureDiskInputDetails) UnmarshalJSON(data []byte) error { case "diskId": err = unpopulate(val, "DiskID", &h.DiskID) delete(rawMsg, key) + case "diskSizeInGB": + err = unpopulate(val, "DiskSizeInGB", &h.DiskSizeInGB) + delete(rawMsg, key) case "diskType": err = unpopulate(val, "DiskType", &h.DiskType) delete(rawMsg, key) + case "iops": + err = unpopulate(val, "Iops", &h.Iops) + delete(rawMsg, key) case "logStorageAccountId": err = unpopulate(val, "LogStorageAccountID", &h.LogStorageAccountID) delete(rawMsg, key) + case "sectorSizeInBytes": + err = unpopulate(val, "SectorSizeInBytes", &h.SectorSizeInBytes) + delete(rawMsg, key) + case "throughputInMbps": + err = unpopulate(val, "ThroughputInMbps", &h.ThroughputInMbps) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", h, err) @@ -5981,6 +7046,7 @@ func (h HyperVReplicaAzureEnableProtectionInput) MarshalJSON() ([]byte, error) { populate(objectMap, "hvHostVmId", h.HvHostVMID) objectMap["instanceType"] = "HyperVReplicaAzure" populate(objectMap, "licenseType", h.LicenseType) + populate(objectMap, "linuxLicenseType", h.LinuxLicenseType) populate(objectMap, "logStorageAccountId", h.LogStorageAccountID) populate(objectMap, "osType", h.OSType) populate(objectMap, "sqlServerLicenseType", h.SQLServerLicenseType) @@ -5996,10 +7062,12 @@ func (h HyperVReplicaAzureEnableProtectionInput) MarshalJSON() ([]byte, error) { populate(objectMap, "targetNicTags", h.TargetNicTags) populate(objectMap, "targetProximityPlacementGroupId", h.TargetProximityPlacementGroupID) populate(objectMap, "targetStorageAccountId", h.TargetStorageAccountID) + populate(objectMap, "targetVmSecurityProfile", h.TargetVMSecurityProfile) populate(objectMap, "targetVmSize", h.TargetVMSize) populate(objectMap, "targetVmTags", h.TargetVMTags) populate(objectMap, "useManagedDisks", h.UseManagedDisks) populate(objectMap, "useManagedDisksForReplication", h.UseManagedDisksForReplication) + populate(objectMap, "userSelectedOSName", h.UserSelectedOSName) populate(objectMap, "vmName", h.VMName) populate(objectMap, "vhdId", h.VhdID) return json.Marshal(objectMap) @@ -6038,6 +7106,9 @@ func (h *HyperVReplicaAzureEnableProtectionInput) UnmarshalJSON(data []byte) err case "licenseType": err = unpopulate(val, "LicenseType", &h.LicenseType) delete(rawMsg, key) + case "linuxLicenseType": + err = unpopulate(val, "LinuxLicenseType", &h.LinuxLicenseType) + delete(rawMsg, key) case "logStorageAccountId": err = unpopulate(val, "LogStorageAccountID", &h.LogStorageAccountID) delete(rawMsg, key) @@ -6083,6 +7154,9 @@ func (h *HyperVReplicaAzureEnableProtectionInput) UnmarshalJSON(data []byte) err case "targetStorageAccountId": err = unpopulate(val, "TargetStorageAccountID", &h.TargetStorageAccountID) delete(rawMsg, key) + case "targetVmSecurityProfile": + err = unpopulate(val, "TargetVMSecurityProfile", &h.TargetVMSecurityProfile) + delete(rawMsg, key) case "targetVmSize": err = unpopulate(val, "TargetVMSize", &h.TargetVMSize) delete(rawMsg, key) @@ -6095,6 +7169,9 @@ func (h *HyperVReplicaAzureEnableProtectionInput) UnmarshalJSON(data []byte) err case "useManagedDisksForReplication": err = unpopulate(val, "UseManagedDisksForReplication", &h.UseManagedDisksForReplication) delete(rawMsg, key) + case "userSelectedOSName": + err = unpopulate(val, "UserSelectedOSName", &h.UserSelectedOSName) + delete(rawMsg, key) case "vmName": err = unpopulate(val, "VMName", &h.VMName) delete(rawMsg, key) @@ -6192,8 +7269,13 @@ func (h HyperVReplicaAzureManagedDiskDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "diskEncryptionSetId", h.DiskEncryptionSetID) populate(objectMap, "diskId", h.DiskID) + populate(objectMap, "diskSizeInGB", h.DiskSizeInGB) + populate(objectMap, "iops", h.Iops) populate(objectMap, "replicaDiskType", h.ReplicaDiskType) + populate(objectMap, "sectorSizeInBytes", h.SectorSizeInBytes) populate(objectMap, "seedManagedDiskId", h.SeedManagedDiskID) + populate(objectMap, "targetDiskAccountType", h.TargetDiskAccountType) + populate(objectMap, "throughputInMbps", h.ThroughputInMbps) return json.Marshal(objectMap) } @@ -6212,12 +7294,27 @@ func (h *HyperVReplicaAzureManagedDiskDetails) UnmarshalJSON(data []byte) error case "diskId": err = unpopulate(val, "DiskID", &h.DiskID) delete(rawMsg, key) + case "diskSizeInGB": + err = unpopulate(val, "DiskSizeInGB", &h.DiskSizeInGB) + delete(rawMsg, key) + case "iops": + err = unpopulate(val, "Iops", &h.Iops) + delete(rawMsg, key) case "replicaDiskType": err = unpopulate(val, "ReplicaDiskType", &h.ReplicaDiskType) delete(rawMsg, key) + case "sectorSizeInBytes": + err = unpopulate(val, "SectorSizeInBytes", &h.SectorSizeInBytes) + delete(rawMsg, key) case "seedManagedDiskId": err = unpopulate(val, "SeedManagedDiskID", &h.SeedManagedDiskID) delete(rawMsg, key) + case "targetDiskAccountType": + err = unpopulate(val, "TargetDiskAccountType", &h.TargetDiskAccountType) + delete(rawMsg, key) + case "throughputInMbps": + err = unpopulate(val, "ThroughputInMbps", &h.ThroughputInMbps) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", h, err) @@ -6380,6 +7477,7 @@ func (h HyperVReplicaAzureReplicationDetails) MarshalJSON() ([]byte, error) { populateDateTimeRFC3339(objectMap, "lastReplicatedTime", h.LastReplicatedTime) populateDateTimeRFC3339(objectMap, "lastRpoCalculatedTime", h.LastRpoCalculatedTime) populate(objectMap, "licenseType", h.LicenseType) + populate(objectMap, "linuxLicenseType", h.LinuxLicenseType) populate(objectMap, "oSDetails", h.OSDetails) populate(objectMap, "protectedManagedDisks", h.ProtectedManagedDisks) populate(objectMap, "recoveryAvailabilitySetId", h.RecoveryAvailabilitySetID) @@ -6399,6 +7497,7 @@ func (h HyperVReplicaAzureReplicationDetails) MarshalJSON() ([]byte, error) { populate(objectMap, "targetManagedDiskTags", h.TargetManagedDiskTags) populate(objectMap, "targetNicTags", h.TargetNicTags) populate(objectMap, "targetProximityPlacementGroupId", h.TargetProximityPlacementGroupID) + populate(objectMap, "targetVmSecurityProfile", h.TargetVMSecurityProfile) populate(objectMap, "targetVmTags", h.TargetVMTags) populate(objectMap, "useManagedDisks", h.UseManagedDisks) populate(objectMap, "vmId", h.VMID) @@ -6447,6 +7546,9 @@ func (h *HyperVReplicaAzureReplicationDetails) UnmarshalJSON(data []byte) error case "licenseType": err = unpopulate(val, "LicenseType", &h.LicenseType) delete(rawMsg, key) + case "linuxLicenseType": + err = unpopulate(val, "LinuxLicenseType", &h.LinuxLicenseType) + delete(rawMsg, key) case "oSDetails": err = unpopulate(val, "OSDetails", &h.OSDetails) delete(rawMsg, key) @@ -6504,6 +7606,9 @@ func (h *HyperVReplicaAzureReplicationDetails) UnmarshalJSON(data []byte) error case "targetProximityPlacementGroupId": err = unpopulate(val, "TargetProximityPlacementGroupID", &h.TargetProximityPlacementGroupID) delete(rawMsg, key) + case "targetVmSecurityProfile": + err = unpopulate(val, "TargetVMSecurityProfile", &h.TargetVMSecurityProfile) + delete(rawMsg, key) case "targetVmTags": err = unpopulate(val, "TargetVMTags", &h.TargetVMTags) delete(rawMsg, key) @@ -6668,6 +7773,7 @@ func (h HyperVReplicaAzureUpdateReplicationProtectedItemInput) MarshalJSON() ([] objectMap := make(map[string]any) populate(objectMap, "diskIdToDiskEncryptionMap", h.DiskIDToDiskEncryptionMap) objectMap["instanceType"] = "HyperVReplicaAzure" + populate(objectMap, "linuxLicenseType", h.LinuxLicenseType) populate(objectMap, "recoveryAzureV1ResourceGroupId", h.RecoveryAzureV1ResourceGroupID) populate(objectMap, "recoveryAzureV2ResourceGroupId", h.RecoveryAzureV2ResourceGroupID) populate(objectMap, "sqlServerLicenseType", h.SQLServerLicenseType) @@ -6677,6 +7783,7 @@ func (h HyperVReplicaAzureUpdateReplicationProtectedItemInput) MarshalJSON() ([] populate(objectMap, "targetProximityPlacementGroupId", h.TargetProximityPlacementGroupID) populate(objectMap, "targetVmTags", h.TargetVMTags) populate(objectMap, "useManagedDisks", h.UseManagedDisks) + populate(objectMap, "userSelectedOSName", h.UserSelectedOSName) populate(objectMap, "vmDisks", h.VMDisks) return json.Marshal(objectMap) } @@ -6696,6 +7803,9 @@ func (h *HyperVReplicaAzureUpdateReplicationProtectedItemInput) UnmarshalJSON(da case "instanceType": err = unpopulate(val, "InstanceType", &h.InstanceType) delete(rawMsg, key) + case "linuxLicenseType": + err = unpopulate(val, "LinuxLicenseType", &h.LinuxLicenseType) + delete(rawMsg, key) case "recoveryAzureV1ResourceGroupId": err = unpopulate(val, "RecoveryAzureV1ResourceGroupID", &h.RecoveryAzureV1ResourceGroupID) delete(rawMsg, key) @@ -6723,6 +7833,9 @@ func (h *HyperVReplicaAzureUpdateReplicationProtectedItemInput) UnmarshalJSON(da case "useManagedDisks": err = unpopulate(val, "UseManagedDisks", &h.UseManagedDisks) delete(rawMsg, key) + case "userSelectedOSName": + err = unpopulate(val, "UserSelectedOSName", &h.UserSelectedOSName) + delete(rawMsg, key) case "vmDisks": err = unpopulate(val, "VMDisks", &h.VMDisks) delete(rawMsg, key) @@ -9299,6 +10412,37 @@ func (i *InMageProtectedDiskDetails) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type InMageRcmAddDisksInput. +func (i InMageRcmAddDisksInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "disks", i.Disks) + objectMap["instanceType"] = "InMageRcm" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InMageRcmAddDisksInput. +func (i *InMageRcmAddDisksInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "disks": + err = unpopulate(val, "Disks", &i.Disks) + delete(rawMsg, key) + case "instanceType": + err = unpopulate(val, "InstanceType", &i.InstanceType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type InMageRcmAgentUpgradeBlockingErrorDetails. func (i InMageRcmAgentUpgradeBlockingErrorDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -9551,8 +10695,12 @@ func (i InMageRcmDiskInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "diskEncryptionSetId", i.DiskEncryptionSetID) populate(objectMap, "diskId", i.DiskID) + populate(objectMap, "diskSizeInGB", i.DiskSizeInGB) populate(objectMap, "diskType", i.DiskType) + populate(objectMap, "iops", i.Iops) populate(objectMap, "logStorageAccountId", i.LogStorageAccountID) + populate(objectMap, "sectorSizeInBytes", i.SectorSizeInBytes) + populate(objectMap, "throughputInMbps", i.ThroughputInMbps) return json.Marshal(objectMap) } @@ -9571,12 +10719,24 @@ func (i *InMageRcmDiskInput) UnmarshalJSON(data []byte) error { case "diskId": err = unpopulate(val, "DiskID", &i.DiskID) delete(rawMsg, key) + case "diskSizeInGB": + err = unpopulate(val, "DiskSizeInGB", &i.DiskSizeInGB) + delete(rawMsg, key) case "diskType": err = unpopulate(val, "DiskType", &i.DiskType) delete(rawMsg, key) + case "iops": + err = unpopulate(val, "Iops", &i.Iops) + delete(rawMsg, key) case "logStorageAccountId": err = unpopulate(val, "LogStorageAccountID", &i.LogStorageAccountID) delete(rawMsg, key) + case "sectorSizeInBytes": + err = unpopulate(val, "SectorSizeInBytes", &i.SectorSizeInBytes) + delete(rawMsg, key) + case "throughputInMbps": + err = unpopulate(val, "ThroughputInMbps", &i.ThroughputInMbps) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) @@ -9589,8 +10749,12 @@ func (i *InMageRcmDiskInput) UnmarshalJSON(data []byte) error { func (i InMageRcmDisksDefaultInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "diskEncryptionSetId", i.DiskEncryptionSetID) + populate(objectMap, "diskSizeInGB", i.DiskSizeInGB) populate(objectMap, "diskType", i.DiskType) + populate(objectMap, "iops", i.Iops) populate(objectMap, "logStorageAccountId", i.LogStorageAccountID) + populate(objectMap, "sectorSizeInBytes", i.SectorSizeInBytes) + populate(objectMap, "throughputInMbps", i.ThroughputInMbps) return json.Marshal(objectMap) } @@ -9606,12 +10770,24 @@ func (i *InMageRcmDisksDefaultInput) UnmarshalJSON(data []byte) error { case "diskEncryptionSetId": err = unpopulate(val, "DiskEncryptionSetID", &i.DiskEncryptionSetID) delete(rawMsg, key) + case "diskSizeInGB": + err = unpopulate(val, "DiskSizeInGB", &i.DiskSizeInGB) + delete(rawMsg, key) case "diskType": err = unpopulate(val, "DiskType", &i.DiskType) delete(rawMsg, key) + case "iops": + err = unpopulate(val, "Iops", &i.Iops) + delete(rawMsg, key) case "logStorageAccountId": err = unpopulate(val, "LogStorageAccountID", &i.LogStorageAccountID) delete(rawMsg, key) + case "sectorSizeInBytes": + err = unpopulate(val, "SectorSizeInBytes", &i.SectorSizeInBytes) + delete(rawMsg, key) + case "throughputInMbps": + err = unpopulate(val, "ThroughputInMbps", &i.ThroughputInMbps) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) @@ -9628,20 +10804,28 @@ func (i InMageRcmEnableProtectionInput) MarshalJSON() ([]byte, error) { populate(objectMap, "fabricDiscoveryMachineId", i.FabricDiscoveryMachineID) objectMap["instanceType"] = "InMageRcm" populate(objectMap, "licenseType", i.LicenseType) + populate(objectMap, "linuxLicenseType", i.LinuxLicenseType) populate(objectMap, "multiVmGroupName", i.MultiVMGroupName) populate(objectMap, "processServerId", i.ProcessServerID) populate(objectMap, "runAsAccountId", i.RunAsAccountID) + populate(objectMap, "sqlServerLicenseType", i.SQLServerLicenseType) + populate(objectMap, "seedManagedDiskTags", i.SeedManagedDiskTags) populate(objectMap, "targetAvailabilitySetId", i.TargetAvailabilitySetID) populate(objectMap, "targetAvailabilityZone", i.TargetAvailabilityZone) populate(objectMap, "targetBootDiagnosticsStorageAccountId", i.TargetBootDiagnosticsStorageAccountID) + populate(objectMap, "targetManagedDiskTags", i.TargetManagedDiskTags) populate(objectMap, "targetNetworkId", i.TargetNetworkID) + populate(objectMap, "targetNicTags", i.TargetNicTags) populate(objectMap, "targetProximityPlacementGroupId", i.TargetProximityPlacementGroupID) populate(objectMap, "targetResourceGroupId", i.TargetResourceGroupID) populate(objectMap, "targetSubnetName", i.TargetSubnetName) populate(objectMap, "targetVmName", i.TargetVMName) + populate(objectMap, "targetVmSecurityProfile", i.TargetVMSecurityProfile) populate(objectMap, "targetVmSize", i.TargetVMSize) + populate(objectMap, "targetVmTags", i.TargetVMTags) populate(objectMap, "testNetworkId", i.TestNetworkID) populate(objectMap, "testSubnetName", i.TestSubnetName) + populate(objectMap, "userSelectedOSName", i.UserSelectedOSName) return json.Marshal(objectMap) } @@ -9669,6 +10853,9 @@ func (i *InMageRcmEnableProtectionInput) UnmarshalJSON(data []byte) error { case "licenseType": err = unpopulate(val, "LicenseType", &i.LicenseType) delete(rawMsg, key) + case "linuxLicenseType": + err = unpopulate(val, "LinuxLicenseType", &i.LinuxLicenseType) + delete(rawMsg, key) case "multiVmGroupName": err = unpopulate(val, "MultiVMGroupName", &i.MultiVMGroupName) delete(rawMsg, key) @@ -9678,6 +10865,12 @@ func (i *InMageRcmEnableProtectionInput) UnmarshalJSON(data []byte) error { case "runAsAccountId": err = unpopulate(val, "RunAsAccountID", &i.RunAsAccountID) delete(rawMsg, key) + case "sqlServerLicenseType": + err = unpopulate(val, "SQLServerLicenseType", &i.SQLServerLicenseType) + delete(rawMsg, key) + case "seedManagedDiskTags": + err = unpopulate(val, "SeedManagedDiskTags", &i.SeedManagedDiskTags) + delete(rawMsg, key) case "targetAvailabilitySetId": err = unpopulate(val, "TargetAvailabilitySetID", &i.TargetAvailabilitySetID) delete(rawMsg, key) @@ -9687,9 +10880,15 @@ func (i *InMageRcmEnableProtectionInput) UnmarshalJSON(data []byte) error { case "targetBootDiagnosticsStorageAccountId": err = unpopulate(val, "TargetBootDiagnosticsStorageAccountID", &i.TargetBootDiagnosticsStorageAccountID) delete(rawMsg, key) + case "targetManagedDiskTags": + err = unpopulate(val, "TargetManagedDiskTags", &i.TargetManagedDiskTags) + delete(rawMsg, key) case "targetNetworkId": err = unpopulate(val, "TargetNetworkID", &i.TargetNetworkID) delete(rawMsg, key) + case "targetNicTags": + err = unpopulate(val, "TargetNicTags", &i.TargetNicTags) + delete(rawMsg, key) case "targetProximityPlacementGroupId": err = unpopulate(val, "TargetProximityPlacementGroupID", &i.TargetProximityPlacementGroupID) delete(rawMsg, key) @@ -9702,15 +10901,24 @@ func (i *InMageRcmEnableProtectionInput) UnmarshalJSON(data []byte) error { case "targetVmName": err = unpopulate(val, "TargetVMName", &i.TargetVMName) delete(rawMsg, key) + case "targetVmSecurityProfile": + err = unpopulate(val, "TargetVMSecurityProfile", &i.TargetVMSecurityProfile) + delete(rawMsg, key) case "targetVmSize": err = unpopulate(val, "TargetVMSize", &i.TargetVMSize) delete(rawMsg, key) + case "targetVmTags": + err = unpopulate(val, "TargetVMTags", &i.TargetVMTags) + delete(rawMsg, key) case "testNetworkId": err = unpopulate(val, "TestNetworkID", &i.TestNetworkID) delete(rawMsg, key) case "testSubnetName": err = unpopulate(val, "TestSubnetName", &i.TestSubnetName) delete(rawMsg, key) + case "userSelectedOSName": + err = unpopulate(val, "UserSelectedOSName", &i.UserSelectedOSName) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) @@ -10698,6 +11906,7 @@ func (i InMageRcmNicDetails) MarshalJSON() ([]byte, error) { populate(objectMap, "sourceSubnetName", i.SourceSubnetName) populate(objectMap, "targetIPAddress", i.TargetIPAddress) populate(objectMap, "targetIPAddressType", i.TargetIPAddressType) + populate(objectMap, "targetNicName", i.TargetNicName) populate(objectMap, "targetSubnetName", i.TargetSubnetName) populate(objectMap, "testIPAddress", i.TestIPAddress) populate(objectMap, "testIPAddressType", i.TestIPAddressType) @@ -10741,6 +11950,9 @@ func (i *InMageRcmNicDetails) UnmarshalJSON(data []byte) error { case "targetIPAddressType": err = unpopulate(val, "TargetIPAddressType", &i.TargetIPAddressType) delete(rawMsg, key) + case "targetNicName": + err = unpopulate(val, "TargetNicName", &i.TargetNicName) + delete(rawMsg, key) case "targetSubnetName": err = unpopulate(val, "TargetSubnetName", &i.TargetSubnetName) delete(rawMsg, key) @@ -10767,6 +11979,7 @@ func (i InMageRcmNicInput) MarshalJSON() ([]byte, error) { populate(objectMap, "isPrimaryNic", i.IsPrimaryNic) populate(objectMap, "isSelectedForFailover", i.IsSelectedForFailover) populate(objectMap, "nicId", i.NicID) + populate(objectMap, "targetNicName", i.TargetNicName) populate(objectMap, "targetStaticIPAddress", i.TargetStaticIPAddress) populate(objectMap, "targetSubnetName", i.TargetSubnetName) populate(objectMap, "testStaticIPAddress", i.TestStaticIPAddress) @@ -10792,6 +12005,9 @@ func (i *InMageRcmNicInput) UnmarshalJSON(data []byte) error { case "nicId": err = unpopulate(val, "NicID", &i.NicID) delete(rawMsg, key) + case "targetNicName": + err = unpopulate(val, "TargetNicName", &i.TargetNicName) + delete(rawMsg, key) case "targetStaticIPAddress": err = unpopulate(val, "TargetStaticIPAddress", &i.TargetStaticIPAddress) delete(rawMsg, key) @@ -10902,20 +12118,26 @@ func (i *InMageRcmPolicyDetails) UnmarshalJSON(data []byte) error { func (i InMageRcmProtectedDiskDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "capacityInBytes", i.CapacityInBytes) + populate(objectMap, "customTargetDiskName", i.CustomTargetDiskName) populate(objectMap, "dataPendingAtSourceAgentInMB", i.DataPendingAtSourceAgentInMB) populate(objectMap, "dataPendingInLogDataStoreInMB", i.DataPendingInLogDataStoreInMB) populate(objectMap, "diskEncryptionSetId", i.DiskEncryptionSetID) populate(objectMap, "diskId", i.DiskID) populate(objectMap, "diskName", i.DiskName) + populate(objectMap, "diskSizeInGB", i.DiskSizeInGB) + populate(objectMap, "diskState", i.DiskState) populate(objectMap, "diskType", i.DiskType) + populate(objectMap, "iops", i.Iops) populate(objectMap, "irDetails", i.IrDetails) populate(objectMap, "isInitialReplicationComplete", i.IsInitialReplicationComplete) populate(objectMap, "isOSDisk", i.IsOSDisk) populate(objectMap, "logStorageAccountId", i.LogStorageAccountID) populate(objectMap, "resyncDetails", i.ResyncDetails) + populate(objectMap, "sectorSizeInBytes", i.SectorSizeInBytes) populate(objectMap, "seedBlobUri", i.SeedBlobURI) populate(objectMap, "seedManagedDiskId", i.SeedManagedDiskID) populate(objectMap, "targetManagedDiskId", i.TargetManagedDiskID) + populate(objectMap, "throughputInMbps", i.ThroughputInMbps) return json.Marshal(objectMap) } @@ -10931,6 +12153,9 @@ func (i *InMageRcmProtectedDiskDetails) UnmarshalJSON(data []byte) error { case "capacityInBytes": err = unpopulate(val, "CapacityInBytes", &i.CapacityInBytes) delete(rawMsg, key) + case "customTargetDiskName": + err = unpopulate(val, "CustomTargetDiskName", &i.CustomTargetDiskName) + delete(rawMsg, key) case "dataPendingAtSourceAgentInMB": err = unpopulate(val, "DataPendingAtSourceAgentInMB", &i.DataPendingAtSourceAgentInMB) delete(rawMsg, key) @@ -10946,9 +12171,18 @@ func (i *InMageRcmProtectedDiskDetails) UnmarshalJSON(data []byte) error { case "diskName": err = unpopulate(val, "DiskName", &i.DiskName) delete(rawMsg, key) + case "diskSizeInGB": + err = unpopulate(val, "DiskSizeInGB", &i.DiskSizeInGB) + delete(rawMsg, key) + case "diskState": + err = unpopulate(val, "DiskState", &i.DiskState) + delete(rawMsg, key) case "diskType": err = unpopulate(val, "DiskType", &i.DiskType) delete(rawMsg, key) + case "iops": + err = unpopulate(val, "Iops", &i.Iops) + delete(rawMsg, key) case "irDetails": err = unpopulate(val, "IrDetails", &i.IrDetails) delete(rawMsg, key) @@ -10964,6 +12198,9 @@ func (i *InMageRcmProtectedDiskDetails) UnmarshalJSON(data []byte) error { case "resyncDetails": err = unpopulate(val, "ResyncDetails", &i.ResyncDetails) delete(rawMsg, key) + case "sectorSizeInBytes": + err = unpopulate(val, "SectorSizeInBytes", &i.SectorSizeInBytes) + delete(rawMsg, key) case "seedBlobUri": err = unpopulate(val, "SeedBlobURI", &i.SeedBlobURI) delete(rawMsg, key) @@ -10973,6 +12210,9 @@ func (i *InMageRcmProtectedDiskDetails) UnmarshalJSON(data []byte) error { case "targetManagedDiskId": err = unpopulate(val, "TargetManagedDiskID", &i.TargetManagedDiskID) delete(rawMsg, key) + case "throughputInMbps": + err = unpopulate(val, "ThroughputInMbps", &i.ThroughputInMbps) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) @@ -11071,8 +12311,10 @@ func (i InMageRcmReplicationDetails) MarshalJSON() ([]byte, error) { populateDateTimeRFC3339(objectMap, "lastRpoCalculatedTime", i.LastRpoCalculatedTime) populate(objectMap, "lastRpoInSeconds", i.LastRpoInSeconds) populate(objectMap, "licenseType", i.LicenseType) + populate(objectMap, "linuxLicenseType", i.LinuxLicenseType) populate(objectMap, "mobilityAgentDetails", i.MobilityAgentDetails) populate(objectMap, "multiVmGroupName", i.MultiVMGroupName) + populate(objectMap, "osName", i.OSName) populate(objectMap, "osType", i.OSType) populate(objectMap, "primaryNicIpAddress", i.PrimaryNicIPAddress) populate(objectMap, "processServerId", i.ProcessServerID) @@ -11086,18 +12328,26 @@ func (i InMageRcmReplicationDetails) MarshalJSON() ([]byte, error) { populate(objectMap, "resyncState", i.ResyncState) populate(objectMap, "resyncTransferredBytes", i.ResyncTransferredBytes) populate(objectMap, "runAsAccountId", i.RunAsAccountID) + populate(objectMap, "sqlServerLicenseType", i.SQLServerLicenseType) + populate(objectMap, "seedManagedDiskTags", i.SeedManagedDiskTags) populate(objectMap, "storageAccountId", i.StorageAccountID) + populate(objectMap, "supportedOSVersions", i.SupportedOSVersions) populate(objectMap, "targetAvailabilitySetId", i.TargetAvailabilitySetID) populate(objectMap, "targetAvailabilityZone", i.TargetAvailabilityZone) populate(objectMap, "targetBootDiagnosticsStorageAccountId", i.TargetBootDiagnosticsStorageAccountID) populate(objectMap, "targetGeneration", i.TargetGeneration) populate(objectMap, "targetLocation", i.TargetLocation) + populate(objectMap, "targetManagedDiskTags", i.TargetManagedDiskTags) populate(objectMap, "targetNetworkId", i.TargetNetworkID) + populate(objectMap, "targetNicTags", i.TargetNicTags) populate(objectMap, "targetProximityPlacementGroupId", i.TargetProximityPlacementGroupID) populate(objectMap, "targetResourceGroupId", i.TargetResourceGroupID) populate(objectMap, "targetVmName", i.TargetVMName) + populate(objectMap, "targetVmSecurityProfile", i.TargetVMSecurityProfile) populate(objectMap, "targetVmSize", i.TargetVMSize) + populate(objectMap, "targetVmTags", i.TargetVMTags) populate(objectMap, "testNetworkId", i.TestNetworkID) + populate(objectMap, "unprotectedDisks", i.UnprotectedDisks) populate(objectMap, "vmNics", i.VMNics) return json.Marshal(objectMap) } @@ -11186,12 +12436,18 @@ func (i *InMageRcmReplicationDetails) UnmarshalJSON(data []byte) error { case "licenseType": err = unpopulate(val, "LicenseType", &i.LicenseType) delete(rawMsg, key) + case "linuxLicenseType": + err = unpopulate(val, "LinuxLicenseType", &i.LinuxLicenseType) + delete(rawMsg, key) case "mobilityAgentDetails": err = unpopulate(val, "MobilityAgentDetails", &i.MobilityAgentDetails) delete(rawMsg, key) case "multiVmGroupName": err = unpopulate(val, "MultiVMGroupName", &i.MultiVMGroupName) 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) @@ -11231,9 +12487,18 @@ func (i *InMageRcmReplicationDetails) UnmarshalJSON(data []byte) error { case "runAsAccountId": err = unpopulate(val, "RunAsAccountID", &i.RunAsAccountID) delete(rawMsg, key) + case "sqlServerLicenseType": + err = unpopulate(val, "SQLServerLicenseType", &i.SQLServerLicenseType) + delete(rawMsg, key) + case "seedManagedDiskTags": + err = unpopulate(val, "SeedManagedDiskTags", &i.SeedManagedDiskTags) + delete(rawMsg, key) case "storageAccountId": err = unpopulate(val, "StorageAccountID", &i.StorageAccountID) delete(rawMsg, key) + case "supportedOSVersions": + err = unpopulate(val, "SupportedOSVersions", &i.SupportedOSVersions) + delete(rawMsg, key) case "targetAvailabilitySetId": err = unpopulate(val, "TargetAvailabilitySetID", &i.TargetAvailabilitySetID) delete(rawMsg, key) @@ -11249,9 +12514,15 @@ func (i *InMageRcmReplicationDetails) UnmarshalJSON(data []byte) error { case "targetLocation": err = unpopulate(val, "TargetLocation", &i.TargetLocation) delete(rawMsg, key) + case "targetManagedDiskTags": + err = unpopulate(val, "TargetManagedDiskTags", &i.TargetManagedDiskTags) + delete(rawMsg, key) case "targetNetworkId": err = unpopulate(val, "TargetNetworkID", &i.TargetNetworkID) delete(rawMsg, key) + case "targetNicTags": + err = unpopulate(val, "TargetNicTags", &i.TargetNicTags) + delete(rawMsg, key) case "targetProximityPlacementGroupId": err = unpopulate(val, "TargetProximityPlacementGroupID", &i.TargetProximityPlacementGroupID) delete(rawMsg, key) @@ -11261,12 +12532,21 @@ func (i *InMageRcmReplicationDetails) UnmarshalJSON(data []byte) error { case "targetVmName": err = unpopulate(val, "TargetVMName", &i.TargetVMName) delete(rawMsg, key) + case "targetVmSecurityProfile": + err = unpopulate(val, "TargetVMSecurityProfile", &i.TargetVMSecurityProfile) + delete(rawMsg, key) case "targetVmSize": err = unpopulate(val, "TargetVMSize", &i.TargetVMSize) delete(rawMsg, key) + case "targetVmTags": + err = unpopulate(val, "TargetVMTags", &i.TargetVMTags) + delete(rawMsg, key) case "testNetworkId": err = unpopulate(val, "TestNetworkID", &i.TestNetworkID) delete(rawMsg, key) + case "unprotectedDisks": + err = unpopulate(val, "UnprotectedDisks", &i.UnprotectedDisks) + delete(rawMsg, key) case "vmNics": err = unpopulate(val, "VMNics", &i.VMNics) delete(rawMsg, key) @@ -11381,6 +12661,7 @@ func (i InMageRcmTestFailoverInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["instanceType"] = "InMageRcm" populate(objectMap, "networkId", i.NetworkID) + populate(objectMap, "osUpgradeVersion", i.OSUpgradeVersion) populate(objectMap, "recoveryPointId", i.RecoveryPointID) return json.Marshal(objectMap) } @@ -11400,6 +12681,9 @@ func (i *InMageRcmTestFailoverInput) UnmarshalJSON(data []byte) error { case "networkId": err = unpopulate(val, "NetworkID", &i.NetworkID) 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) @@ -11411,10 +12695,46 @@ func (i *InMageRcmTestFailoverInput) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type InMageRcmUnProtectedDiskDetails. +func (i InMageRcmUnProtectedDiskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "capacityInBytes", i.CapacityInBytes) + populate(objectMap, "diskId", i.DiskID) + populate(objectMap, "diskName", i.DiskName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InMageRcmUnProtectedDiskDetails. +func (i *InMageRcmUnProtectedDiskDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "capacityInBytes": + err = unpopulate(val, "CapacityInBytes", &i.CapacityInBytes) + delete(rawMsg, key) + case "diskId": + err = unpopulate(val, "DiskID", &i.DiskID) + delete(rawMsg, key) + case "diskName": + err = unpopulate(val, "DiskName", &i.DiskName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type InMageRcmUnplannedFailoverInput. func (i InMageRcmUnplannedFailoverInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["instanceType"] = "InMageRcm" + populate(objectMap, "osUpgradeVersion", i.OSUpgradeVersion) populate(objectMap, "performShutdown", i.PerformShutdown) populate(objectMap, "recoveryPointId", i.RecoveryPointID) return json.Marshal(objectMap) @@ -11432,6 +12752,9 @@ func (i *InMageRcmUnplannedFailoverInput) 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 "performShutdown": err = unpopulate(val, "PerformShutdown", &i.PerformShutdown) delete(rawMsg, key) @@ -11513,15 +12836,21 @@ func (i InMageRcmUpdateReplicationProtectedItemInput) MarshalJSON() ([]byte, err objectMap := make(map[string]any) objectMap["instanceType"] = "InMageRcm" populate(objectMap, "licenseType", i.LicenseType) + populate(objectMap, "linuxLicenseType", i.LinuxLicenseType) + populate(objectMap, "sqlServerLicenseType", i.SQLServerLicenseType) populate(objectMap, "targetAvailabilitySetId", i.TargetAvailabilitySetID) populate(objectMap, "targetAvailabilityZone", i.TargetAvailabilityZone) populate(objectMap, "targetBootDiagnosticsStorageAccountId", i.TargetBootDiagnosticsStorageAccountID) + populate(objectMap, "targetManagedDiskTags", i.TargetManagedDiskTags) populate(objectMap, "targetNetworkId", i.TargetNetworkID) + populate(objectMap, "targetNicTags", i.TargetNicTags) populate(objectMap, "targetProximityPlacementGroupId", i.TargetProximityPlacementGroupID) populate(objectMap, "targetResourceGroupId", i.TargetResourceGroupID) populate(objectMap, "targetVmName", i.TargetVMName) populate(objectMap, "targetVmSize", i.TargetVMSize) + populate(objectMap, "targetVmTags", i.TargetVMTags) populate(objectMap, "testNetworkId", i.TestNetworkID) + populate(objectMap, "userSelectedOSName", i.UserSelectedOSName) populate(objectMap, "vmNics", i.VMNics) return json.Marshal(objectMap) } @@ -11541,6 +12870,12 @@ func (i *InMageRcmUpdateReplicationProtectedItemInput) UnmarshalJSON(data []byte case "licenseType": err = unpopulate(val, "LicenseType", &i.LicenseType) delete(rawMsg, key) + case "linuxLicenseType": + err = unpopulate(val, "LinuxLicenseType", &i.LinuxLicenseType) + delete(rawMsg, key) + case "sqlServerLicenseType": + err = unpopulate(val, "SQLServerLicenseType", &i.SQLServerLicenseType) + delete(rawMsg, key) case "targetAvailabilitySetId": err = unpopulate(val, "TargetAvailabilitySetID", &i.TargetAvailabilitySetID) delete(rawMsg, key) @@ -11550,9 +12885,15 @@ func (i *InMageRcmUpdateReplicationProtectedItemInput) UnmarshalJSON(data []byte case "targetBootDiagnosticsStorageAccountId": err = unpopulate(val, "TargetBootDiagnosticsStorageAccountID", &i.TargetBootDiagnosticsStorageAccountID) delete(rawMsg, key) + case "targetManagedDiskTags": + err = unpopulate(val, "TargetManagedDiskTags", &i.TargetManagedDiskTags) + delete(rawMsg, key) case "targetNetworkId": err = unpopulate(val, "TargetNetworkID", &i.TargetNetworkID) delete(rawMsg, key) + case "targetNicTags": + err = unpopulate(val, "TargetNicTags", &i.TargetNicTags) + delete(rawMsg, key) case "targetProximityPlacementGroupId": err = unpopulate(val, "TargetProximityPlacementGroupID", &i.TargetProximityPlacementGroupID) delete(rawMsg, key) @@ -11565,9 +12906,15 @@ func (i *InMageRcmUpdateReplicationProtectedItemInput) UnmarshalJSON(data []byte case "targetVmSize": err = unpopulate(val, "TargetVMSize", &i.TargetVMSize) delete(rawMsg, key) + case "targetVmTags": + err = unpopulate(val, "TargetVMTags", &i.TargetVMTags) + delete(rawMsg, key) case "testNetworkId": err = unpopulate(val, "TestNetworkID", &i.TestNetworkID) delete(rawMsg, key) + case "userSelectedOSName": + err = unpopulate(val, "UserSelectedOSName", &i.UserSelectedOSName) + delete(rawMsg, key) case "vmNics": err = unpopulate(val, "VMNics", &i.VMNics) delete(rawMsg, key) @@ -12696,6 +14043,41 @@ func (l *LogicalNetworkProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ManagedRunCommandScriptInput. +func (m ManagedRunCommandScriptInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "scriptParameters", m.ScriptParameters) + populate(objectMap, "scriptUrl", m.ScriptURL) + populate(objectMap, "stepName", m.StepName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedRunCommandScriptInput. +func (m *ManagedRunCommandScriptInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "scriptParameters": + err = unpopulate(val, "ScriptParameters", &m.ScriptParameters) + delete(rawMsg, key) + case "scriptUrl": + err = unpopulate(val, "ScriptURL", &m.ScriptURL) + delete(rawMsg, key) + case "stepName": + err = unpopulate(val, "StepName", &m.StepName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ManualActionTaskDetails. func (m ManualActionTaskDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -13713,6 +15095,7 @@ func (o OSDetails) MarshalJSON() ([]byte, error) { populate(objectMap, "osType", o.OSType) populate(objectMap, "oSVersion", o.OSVersion) populate(objectMap, "productType", o.ProductType) + populate(objectMap, "userSelectedOSName", o.UserSelectedOSName) return json.Marshal(objectMap) } @@ -13743,6 +15126,9 @@ func (o *OSDetails) UnmarshalJSON(data []byte) error { case "productType": err = unpopulate(val, "ProductType", &o.ProductType) delete(rawMsg, key) + case "userSelectedOSName": + err = unpopulate(val, "UserSelectedOSName", &o.UserSelectedOSName) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -16783,15 +18169,45 @@ func (r *RecoveryServicesProviderProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RecoveryVirtualNetworkCustomDetails. -func (r RecoveryVirtualNetworkCustomDetails) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecoveryVirtualNetworkCustomDetails. +func (r RecoveryVirtualNetworkCustomDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["resourceType"] = r.ResourceType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoveryVirtualNetworkCustomDetails. +func (r *RecoveryVirtualNetworkCustomDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "resourceType": + err = unpopulate(val, "ResourceType", &r.ResourceType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RegisteredClusterNodes. +func (r RegisteredClusterNodes) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["resourceType"] = r.ResourceType + populate(objectMap, "biosId", r.BiosID) + populate(objectMap, "clusterNodeFqdn", r.ClusterNodeFqdn) + populate(objectMap, "isSharedDiskVirtualNode", r.IsSharedDiskVirtualNode) + populate(objectMap, "machineId", r.MachineID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RecoveryVirtualNetworkCustomDetails. -func (r *RecoveryVirtualNetworkCustomDetails) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegisteredClusterNodes. +func (r *RegisteredClusterNodes) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -16799,8 +18215,17 @@ func (r *RecoveryVirtualNetworkCustomDetails) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "resourceType": - err = unpopulate(val, "ResourceType", &r.ResourceType) + case "biosId": + err = unpopulate(val, "BiosID", &r.BiosID) + delete(rawMsg, key) + case "clusterNodeFqdn": + err = unpopulate(val, "ClusterNodeFqdn", &r.ClusterNodeFqdn) + delete(rawMsg, key) + case "isSharedDiskVirtualNode": + err = unpopulate(val, "IsSharedDiskVirtualNode", &r.IsSharedDiskVirtualNode) + delete(rawMsg, key) + case "machineId": + err = unpopulate(val, "MachineID", &r.MachineID) delete(rawMsg, key) } if err != nil { @@ -17112,6 +18537,33 @@ func (r *ReplicationApplianceProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ReplicationClusterProviderSpecificSettings. +func (r ReplicationClusterProviderSpecificSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["instanceType"] = r.InstanceType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationClusterProviderSpecificSettings. +func (r *ReplicationClusterProviderSpecificSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "instanceType": + err = unpopulate(val, "InstanceType", &r.InstanceType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ReplicationEligibilityResults. func (r ReplicationEligibilityResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -17279,19 +18731,235 @@ func (r *ReplicationGroupDetails) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ReplicationProtectedItem. -func (r ReplicationProtectedItem) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ReplicationProtectedItem. +func (r ReplicationProtectedItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationProtectedItem. +func (r *ReplicationProtectedItem) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ReplicationProtectedItemCollection. +func (r ReplicationProtectedItemCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationProtectedItemCollection. +func (r *ReplicationProtectedItemCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ReplicationProtectedItemProperties. +func (r ReplicationProtectedItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "activeLocation", r.ActiveLocation) + populate(objectMap, "allowedOperations", r.AllowedOperations) + populate(objectMap, "currentScenario", r.CurrentScenario) + populate(objectMap, "eventCorrelationId", r.EventCorrelationID) + populate(objectMap, "failoverHealth", r.FailoverHealth) + populate(objectMap, "failoverRecoveryPointId", r.FailoverRecoveryPointID) + populate(objectMap, "friendlyName", r.FriendlyName) + populate(objectMap, "healthErrors", r.HealthErrors) + populateDateTimeRFC3339(objectMap, "lastSuccessfulFailoverTime", r.LastSuccessfulFailoverTime) + populateDateTimeRFC3339(objectMap, "lastSuccessfulTestFailoverTime", r.LastSuccessfulTestFailoverTime) + populate(objectMap, "policyFriendlyName", r.PolicyFriendlyName) + populate(objectMap, "policyId", r.PolicyID) + populate(objectMap, "primaryFabricFriendlyName", r.PrimaryFabricFriendlyName) + populate(objectMap, "primaryFabricProvider", r.PrimaryFabricProvider) + populate(objectMap, "primaryProtectionContainerFriendlyName", r.PrimaryProtectionContainerFriendlyName) + populate(objectMap, "protectableItemId", r.ProtectableItemID) + populate(objectMap, "protectedItemType", r.ProtectedItemType) + populate(objectMap, "protectionState", r.ProtectionState) + populate(objectMap, "protectionStateDescription", r.ProtectionStateDescription) + populate(objectMap, "providerSpecificDetails", r.ProviderSpecificDetails) + populate(objectMap, "recoveryContainerId", r.RecoveryContainerID) + populate(objectMap, "recoveryFabricFriendlyName", r.RecoveryFabricFriendlyName) + populate(objectMap, "recoveryFabricId", r.RecoveryFabricID) + populate(objectMap, "recoveryProtectionContainerFriendlyName", r.RecoveryProtectionContainerFriendlyName) + populate(objectMap, "recoveryServicesProviderId", r.RecoveryServicesProviderID) + populate(objectMap, "replicationHealth", r.ReplicationHealth) + populate(objectMap, "switchProviderState", r.SwitchProviderState) + populate(objectMap, "switchProviderStateDescription", r.SwitchProviderStateDescription) + populate(objectMap, "testFailoverState", r.TestFailoverState) + populate(objectMap, "testFailoverStateDescription", r.TestFailoverStateDescription) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationProtectedItemProperties. +func (r *ReplicationProtectedItemProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "activeLocation": + err = unpopulate(val, "ActiveLocation", &r.ActiveLocation) + delete(rawMsg, key) + case "allowedOperations": + err = unpopulate(val, "AllowedOperations", &r.AllowedOperations) + delete(rawMsg, key) + case "currentScenario": + err = unpopulate(val, "CurrentScenario", &r.CurrentScenario) + delete(rawMsg, key) + case "eventCorrelationId": + err = unpopulate(val, "EventCorrelationID", &r.EventCorrelationID) + delete(rawMsg, key) + case "failoverHealth": + err = unpopulate(val, "FailoverHealth", &r.FailoverHealth) + delete(rawMsg, key) + case "failoverRecoveryPointId": + err = unpopulate(val, "FailoverRecoveryPointID", &r.FailoverRecoveryPointID) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &r.FriendlyName) + delete(rawMsg, key) + case "healthErrors": + err = unpopulate(val, "HealthErrors", &r.HealthErrors) + delete(rawMsg, key) + case "lastSuccessfulFailoverTime": + err = unpopulateDateTimeRFC3339(val, "LastSuccessfulFailoverTime", &r.LastSuccessfulFailoverTime) + delete(rawMsg, key) + case "lastSuccessfulTestFailoverTime": + err = unpopulateDateTimeRFC3339(val, "LastSuccessfulTestFailoverTime", &r.LastSuccessfulTestFailoverTime) + delete(rawMsg, key) + case "policyFriendlyName": + err = unpopulate(val, "PolicyFriendlyName", &r.PolicyFriendlyName) + delete(rawMsg, key) + case "policyId": + err = unpopulate(val, "PolicyID", &r.PolicyID) + delete(rawMsg, key) + case "primaryFabricFriendlyName": + err = unpopulate(val, "PrimaryFabricFriendlyName", &r.PrimaryFabricFriendlyName) + delete(rawMsg, key) + case "primaryFabricProvider": + err = unpopulate(val, "PrimaryFabricProvider", &r.PrimaryFabricProvider) + delete(rawMsg, key) + case "primaryProtectionContainerFriendlyName": + err = unpopulate(val, "PrimaryProtectionContainerFriendlyName", &r.PrimaryProtectionContainerFriendlyName) + delete(rawMsg, key) + case "protectableItemId": + err = unpopulate(val, "ProtectableItemID", &r.ProtectableItemID) + delete(rawMsg, key) + case "protectedItemType": + err = unpopulate(val, "ProtectedItemType", &r.ProtectedItemType) + delete(rawMsg, key) + case "protectionState": + err = unpopulate(val, "ProtectionState", &r.ProtectionState) + delete(rawMsg, key) + case "protectionStateDescription": + err = unpopulate(val, "ProtectionStateDescription", &r.ProtectionStateDescription) + delete(rawMsg, key) + case "providerSpecificDetails": + r.ProviderSpecificDetails, err = unmarshalReplicationProviderSpecificSettingsClassification(val) + delete(rawMsg, key) + case "recoveryContainerId": + err = unpopulate(val, "RecoveryContainerID", &r.RecoveryContainerID) + delete(rawMsg, key) + case "recoveryFabricFriendlyName": + err = unpopulate(val, "RecoveryFabricFriendlyName", &r.RecoveryFabricFriendlyName) + delete(rawMsg, key) + case "recoveryFabricId": + err = unpopulate(val, "RecoveryFabricID", &r.RecoveryFabricID) + delete(rawMsg, key) + case "recoveryProtectionContainerFriendlyName": + err = unpopulate(val, "RecoveryProtectionContainerFriendlyName", &r.RecoveryProtectionContainerFriendlyName) + delete(rawMsg, key) + case "recoveryServicesProviderId": + err = unpopulate(val, "RecoveryServicesProviderID", &r.RecoveryServicesProviderID) + delete(rawMsg, key) + case "replicationHealth": + err = unpopulate(val, "ReplicationHealth", &r.ReplicationHealth) + delete(rawMsg, key) + case "switchProviderState": + err = unpopulate(val, "SwitchProviderState", &r.SwitchProviderState) + delete(rawMsg, key) + case "switchProviderStateDescription": + err = unpopulate(val, "SwitchProviderStateDescription", &r.SwitchProviderStateDescription) + delete(rawMsg, key) + case "testFailoverState": + err = unpopulate(val, "TestFailoverState", &r.TestFailoverState) + delete(rawMsg, key) + case "testFailoverStateDescription": + err = unpopulate(val, "TestFailoverStateDescription", &r.TestFailoverStateDescription) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ReplicationProtectionCluster. +func (r ReplicationProtectionCluster) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) populate(objectMap, "name", r.Name) populate(objectMap, "properties", r.Properties) populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationProtectedItem. -func (r *ReplicationProtectedItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationProtectionCluster. +func (r *ReplicationProtectionCluster) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -17302,9 +18970,6 @@ func (r *ReplicationProtectedItem) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) @@ -17322,16 +18987,16 @@ func (r *ReplicationProtectedItem) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ReplicationProtectedItemCollection. -func (r ReplicationProtectedItemCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ReplicationProtectionClusterCollection. +func (r ReplicationProtectionClusterCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", r.NextLink) populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationProtectedItemCollection. -func (r *ReplicationProtectedItemCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationProtectionClusterCollection. +func (r *ReplicationProtectionClusterCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -17353,16 +19018,18 @@ func (r *ReplicationProtectedItemCollection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ReplicationProtectedItemProperties. -func (r ReplicationProtectedItemProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ReplicationProtectionClusterProperties. +func (r ReplicationProtectionClusterProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "activeLocation", r.ActiveLocation) + populate(objectMap, "agentClusterId", r.AgentClusterID) populate(objectMap, "allowedOperations", r.AllowedOperations) + populate(objectMap, "areAllClusterNodesRegistered", r.AreAllClusterNodesRegistered) + populate(objectMap, "clusterFqdn", r.ClusterFqdn) + populate(objectMap, "clusterNodeFqdns", r.ClusterNodeFqdns) + populate(objectMap, "clusterProtectedItemIds", r.ClusterProtectedItemIDs) + populate(objectMap, "clusterRegisteredNodes", r.ClusterRegisteredNodes) populate(objectMap, "currentScenario", r.CurrentScenario) - populate(objectMap, "eventCorrelationId", r.EventCorrelationID) - populate(objectMap, "failoverHealth", r.FailoverHealth) - populate(objectMap, "failoverRecoveryPointId", r.FailoverRecoveryPointID) - populate(objectMap, "friendlyName", r.FriendlyName) populate(objectMap, "healthErrors", r.HealthErrors) populateDateTimeRFC3339(objectMap, "lastSuccessfulFailoverTime", r.LastSuccessfulFailoverTime) populateDateTimeRFC3339(objectMap, "lastSuccessfulTestFailoverTime", r.LastSuccessfulTestFailoverTime) @@ -17371,26 +19038,24 @@ func (r ReplicationProtectedItemProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "primaryFabricFriendlyName", r.PrimaryFabricFriendlyName) populate(objectMap, "primaryFabricProvider", r.PrimaryFabricProvider) populate(objectMap, "primaryProtectionContainerFriendlyName", r.PrimaryProtectionContainerFriendlyName) - populate(objectMap, "protectableItemId", r.ProtectableItemID) - populate(objectMap, "protectedItemType", r.ProtectedItemType) + populate(objectMap, "protectionClusterType", r.ProtectionClusterType) populate(objectMap, "protectionState", r.ProtectionState) populate(objectMap, "protectionStateDescription", r.ProtectionStateDescription) populate(objectMap, "providerSpecificDetails", r.ProviderSpecificDetails) + populate(objectMap, "provisioningState", r.ProvisioningState) populate(objectMap, "recoveryContainerId", r.RecoveryContainerID) populate(objectMap, "recoveryFabricFriendlyName", r.RecoveryFabricFriendlyName) populate(objectMap, "recoveryFabricId", r.RecoveryFabricID) populate(objectMap, "recoveryProtectionContainerFriendlyName", r.RecoveryProtectionContainerFriendlyName) - populate(objectMap, "recoveryServicesProviderId", r.RecoveryServicesProviderID) populate(objectMap, "replicationHealth", r.ReplicationHealth) - populate(objectMap, "switchProviderState", r.SwitchProviderState) - populate(objectMap, "switchProviderStateDescription", r.SwitchProviderStateDescription) + populate(objectMap, "sharedDiskProperties", r.SharedDiskProperties) populate(objectMap, "testFailoverState", r.TestFailoverState) populate(objectMap, "testFailoverStateDescription", r.TestFailoverStateDescription) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationProtectedItemProperties. -func (r *ReplicationProtectedItemProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationProtectionClusterProperties. +func (r *ReplicationProtectionClusterProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -17401,23 +19066,29 @@ func (r *ReplicationProtectedItemProperties) UnmarshalJSON(data []byte) error { case "activeLocation": err = unpopulate(val, "ActiveLocation", &r.ActiveLocation) delete(rawMsg, key) + case "agentClusterId": + err = unpopulate(val, "AgentClusterID", &r.AgentClusterID) + delete(rawMsg, key) case "allowedOperations": err = unpopulate(val, "AllowedOperations", &r.AllowedOperations) delete(rawMsg, key) - case "currentScenario": - err = unpopulate(val, "CurrentScenario", &r.CurrentScenario) + case "areAllClusterNodesRegistered": + err = unpopulate(val, "AreAllClusterNodesRegistered", &r.AreAllClusterNodesRegistered) delete(rawMsg, key) - case "eventCorrelationId": - err = unpopulate(val, "EventCorrelationID", &r.EventCorrelationID) + case "clusterFqdn": + err = unpopulate(val, "ClusterFqdn", &r.ClusterFqdn) delete(rawMsg, key) - case "failoverHealth": - err = unpopulate(val, "FailoverHealth", &r.FailoverHealth) + case "clusterNodeFqdns": + err = unpopulate(val, "ClusterNodeFqdns", &r.ClusterNodeFqdns) delete(rawMsg, key) - case "failoverRecoveryPointId": - err = unpopulate(val, "FailoverRecoveryPointID", &r.FailoverRecoveryPointID) + case "clusterProtectedItemIds": + err = unpopulate(val, "ClusterProtectedItemIDs", &r.ClusterProtectedItemIDs) delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &r.FriendlyName) + case "clusterRegisteredNodes": + err = unpopulate(val, "ClusterRegisteredNodes", &r.ClusterRegisteredNodes) + delete(rawMsg, key) + case "currentScenario": + err = unpopulate(val, "CurrentScenario", &r.CurrentScenario) delete(rawMsg, key) case "healthErrors": err = unpopulate(val, "HealthErrors", &r.HealthErrors) @@ -17443,11 +19114,8 @@ func (r *ReplicationProtectedItemProperties) UnmarshalJSON(data []byte) error { case "primaryProtectionContainerFriendlyName": err = unpopulate(val, "PrimaryProtectionContainerFriendlyName", &r.PrimaryProtectionContainerFriendlyName) delete(rawMsg, key) - case "protectableItemId": - err = unpopulate(val, "ProtectableItemID", &r.ProtectableItemID) - delete(rawMsg, key) - case "protectedItemType": - err = unpopulate(val, "ProtectedItemType", &r.ProtectedItemType) + case "protectionClusterType": + err = unpopulate(val, "ProtectionClusterType", &r.ProtectionClusterType) delete(rawMsg, key) case "protectionState": err = unpopulate(val, "ProtectionState", &r.ProtectionState) @@ -17456,7 +19124,10 @@ func (r *ReplicationProtectedItemProperties) UnmarshalJSON(data []byte) error { err = unpopulate(val, "ProtectionStateDescription", &r.ProtectionStateDescription) delete(rawMsg, key) case "providerSpecificDetails": - r.ProviderSpecificDetails, err = unmarshalReplicationProviderSpecificSettingsClassification(val) + r.ProviderSpecificDetails, err = unmarshalReplicationClusterProviderSpecificSettingsClassification(val) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) delete(rawMsg, key) case "recoveryContainerId": err = unpopulate(val, "RecoveryContainerID", &r.RecoveryContainerID) @@ -17470,17 +19141,11 @@ func (r *ReplicationProtectedItemProperties) UnmarshalJSON(data []byte) error { case "recoveryProtectionContainerFriendlyName": err = unpopulate(val, "RecoveryProtectionContainerFriendlyName", &r.RecoveryProtectionContainerFriendlyName) delete(rawMsg, key) - case "recoveryServicesProviderId": - err = unpopulate(val, "RecoveryServicesProviderID", &r.RecoveryServicesProviderID) - delete(rawMsg, key) case "replicationHealth": err = unpopulate(val, "ReplicationHealth", &r.ReplicationHealth) delete(rawMsg, key) - case "switchProviderState": - err = unpopulate(val, "SwitchProviderState", &r.SwitchProviderState) - delete(rawMsg, key) - case "switchProviderStateDescription": - err = unpopulate(val, "SwitchProviderStateDescription", &r.SwitchProviderStateDescription) + case "sharedDiskProperties": + err = unpopulate(val, "SharedDiskProperties", &r.SharedDiskProperties) delete(rawMsg, key) case "testFailoverState": err = unpopulate(val, "TestFailoverState", &r.TestFailoverState) @@ -18384,6 +20049,49 @@ func (s *ScriptActionTaskDetails) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SecurityProfileProperties. +func (s SecurityProfileProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "targetVmConfidentialEncryption", s.TargetVMConfidentialEncryption) + populate(objectMap, "targetVmMonitoring", s.TargetVMMonitoring) + populate(objectMap, "targetVmSecureBoot", s.TargetVMSecureBoot) + populate(objectMap, "targetVmSecurityType", s.TargetVMSecurityType) + populate(objectMap, "targetVmTpm", s.TargetVMTpm) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityProfileProperties. +func (s *SecurityProfileProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "targetVmConfidentialEncryption": + err = unpopulate(val, "TargetVMConfidentialEncryption", &s.TargetVMConfidentialEncryption) + delete(rawMsg, key) + case "targetVmMonitoring": + err = unpopulate(val, "TargetVMMonitoring", &s.TargetVMMonitoring) + delete(rawMsg, key) + case "targetVmSecureBoot": + err = unpopulate(val, "TargetVMSecureBoot", &s.TargetVMSecureBoot) + delete(rawMsg, key) + case "targetVmSecurityType": + err = unpopulate(val, "TargetVMSecurityType", &s.TargetVMSecurityType) + delete(rawMsg, key) + case "targetVmTpm": + err = unpopulate(val, "TargetVMTpm", &s.TargetVMTpm) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ServiceError. func (s ServiceError) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -18427,6 +20135,88 @@ func (s *ServiceError) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SharedDiskReplicationItemProperties. +func (s SharedDiskReplicationItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "activeLocation", s.ActiveLocation) + populate(objectMap, "allowedOperations", s.AllowedOperations) + populate(objectMap, "currentScenario", s.CurrentScenario) + populate(objectMap, "healthErrors", s.HealthErrors) + populate(objectMap, "protectionState", s.ProtectionState) + populate(objectMap, "replicationHealth", s.ReplicationHealth) + populate(objectMap, "sharedDiskProviderSpecificDetails", s.SharedDiskProviderSpecificDetails) + populate(objectMap, "testFailoverState", s.TestFailoverState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SharedDiskReplicationItemProperties. +func (s *SharedDiskReplicationItemProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "activeLocation": + err = unpopulate(val, "ActiveLocation", &s.ActiveLocation) + delete(rawMsg, key) + case "allowedOperations": + err = unpopulate(val, "AllowedOperations", &s.AllowedOperations) + delete(rawMsg, key) + case "currentScenario": + err = unpopulate(val, "CurrentScenario", &s.CurrentScenario) + delete(rawMsg, key) + case "healthErrors": + err = unpopulate(val, "HealthErrors", &s.HealthErrors) + delete(rawMsg, key) + case "protectionState": + err = unpopulate(val, "ProtectionState", &s.ProtectionState) + delete(rawMsg, key) + case "replicationHealth": + err = unpopulate(val, "ReplicationHealth", &s.ReplicationHealth) + delete(rawMsg, key) + case "sharedDiskProviderSpecificDetails": + s.SharedDiskProviderSpecificDetails, err = unmarshalSharedDiskReplicationProviderSpecificSettingsClassification(val) + delete(rawMsg, key) + case "testFailoverState": + err = unpopulate(val, "TestFailoverState", &s.TestFailoverState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SharedDiskReplicationProviderSpecificSettings. +func (s SharedDiskReplicationProviderSpecificSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["instanceType"] = s.InstanceType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SharedDiskReplicationProviderSpecificSettings. +func (s *SharedDiskReplicationProviderSpecificSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "instanceType": + err = unpopulate(val, "InstanceType", &s.InstanceType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type StorageAccountCustomDetails. func (s StorageAccountCustomDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -18881,6 +20671,91 @@ func (s *SupportedOperatingSystems) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SwitchClusterProtectionInput. +func (s SwitchClusterProtectionInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SwitchClusterProtectionInput. +func (s *SwitchClusterProtectionInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SwitchClusterProtectionInputProperties. +func (s SwitchClusterProtectionInputProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "providerSpecificDetails", s.ProviderSpecificDetails) + populate(objectMap, "replicationProtectionClusterName", s.ReplicationProtectionClusterName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SwitchClusterProtectionInputProperties. +func (s *SwitchClusterProtectionInputProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "providerSpecificDetails": + s.ProviderSpecificDetails, err = unmarshalSwitchClusterProtectionProviderSpecificInputClassification(val) + delete(rawMsg, key) + case "replicationProtectionClusterName": + err = unpopulate(val, "ReplicationProtectionClusterName", &s.ReplicationProtectionClusterName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SwitchClusterProtectionProviderSpecificInput. +func (s SwitchClusterProtectionProviderSpecificInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["instanceType"] = s.InstanceType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SwitchClusterProtectionProviderSpecificInput. +func (s *SwitchClusterProtectionProviderSpecificInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "instanceType": + err = unpopulate(val, "InstanceType", &s.InstanceType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SwitchProtectionInput. func (s SwitchProtectionInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -19761,7 +21636,10 @@ func (u *UpdateApplianceForReplicationProtectedItemProviderSpecificInput) Unmars func (u UpdateDiskInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "diskId", u.DiskID) + populate(objectMap, "diskSizeInGB", u.DiskSizeInGB) + populate(objectMap, "iops", u.Iops) populate(objectMap, "targetDiskName", u.TargetDiskName) + populate(objectMap, "throughputInMbps", u.ThroughputInMbps) return json.Marshal(objectMap) } @@ -19777,9 +21655,18 @@ func (u *UpdateDiskInput) UnmarshalJSON(data []byte) error { case "diskId": err = unpopulate(val, "DiskID", &u.DiskID) delete(rawMsg, key) + case "diskSizeInGB": + err = unpopulate(val, "DiskSizeInGB", &u.DiskSizeInGB) + delete(rawMsg, key) + case "iops": + err = unpopulate(val, "Iops", &u.Iops) + delete(rawMsg, key) case "targetDiskName": err = unpopulate(val, "TargetDiskName", &u.TargetDiskName) delete(rawMsg, key) + case "throughputInMbps": + err = unpopulate(val, "ThroughputInMbps", &u.ThroughputInMbps) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", u, err) @@ -20334,6 +22221,37 @@ func (u *UpdateVCenterRequestProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type UserCreatedResourceTag. +func (u UserCreatedResourceTag) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "tagName", u.TagName) + populate(objectMap, "tagValue", u.TagValue) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserCreatedResourceTag. +func (u *UserCreatedResourceTag) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tagName": + err = unpopulate(val, "TagName", &u.TagName) + delete(rawMsg, key) + case "tagValue": + err = unpopulate(val, "TagValue", &u.TagValue) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type VCenter. func (v VCenter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -20775,10 +22693,14 @@ func (v VMwareCbtDiskInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "diskEncryptionSetId", v.DiskEncryptionSetID) populate(objectMap, "diskId", v.DiskID) + populate(objectMap, "diskSizeInGB", v.DiskSizeInGB) populate(objectMap, "diskType", v.DiskType) + populate(objectMap, "iops", v.Iops) populate(objectMap, "isOSDisk", v.IsOSDisk) populate(objectMap, "logStorageAccountId", v.LogStorageAccountID) populate(objectMap, "logStorageAccountSasSecretName", v.LogStorageAccountSasSecretName) + populate(objectMap, "sectorSizeInBytes", v.SectorSizeInBytes) + populate(objectMap, "throughputInMbps", v.ThroughputInMbps) return json.Marshal(objectMap) } @@ -20797,9 +22719,15 @@ func (v *VMwareCbtDiskInput) UnmarshalJSON(data []byte) error { case "diskId": err = unpopulate(val, "DiskID", &v.DiskID) delete(rawMsg, key) + case "diskSizeInGB": + err = unpopulate(val, "DiskSizeInGB", &v.DiskSizeInGB) + delete(rawMsg, key) case "diskType": err = unpopulate(val, "DiskType", &v.DiskType) delete(rawMsg, key) + case "iops": + err = unpopulate(val, "Iops", &v.Iops) + delete(rawMsg, key) case "isOSDisk": err = unpopulate(val, "IsOSDisk", &v.IsOSDisk) delete(rawMsg, key) @@ -20809,6 +22737,12 @@ func (v *VMwareCbtDiskInput) UnmarshalJSON(data []byte) error { case "logStorageAccountSasSecretName": err = unpopulate(val, "LogStorageAccountSasSecretName", &v.LogStorageAccountSasSecretName) delete(rawMsg, key) + case "sectorSizeInBytes": + err = unpopulate(val, "SectorSizeInBytes", &v.SectorSizeInBytes) + delete(rawMsg, key) + case "throughputInMbps": + err = unpopulate(val, "ThroughputInMbps", &v.ThroughputInMbps) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", v, err) @@ -20825,6 +22759,7 @@ func (v VMwareCbtEnableMigrationInput) MarshalJSON() ([]byte, error) { populate(objectMap, "disksToInclude", v.DisksToInclude) objectMap["instanceType"] = "VMwareCbt" populate(objectMap, "licenseType", v.LicenseType) + populate(objectMap, "linuxLicenseType", v.LinuxLicenseType) populate(objectMap, "performAutoResync", v.PerformAutoResync) populate(objectMap, "performSqlBulkRegistration", v.PerformSQLBulkRegistration) populate(objectMap, "sqlServerLicenseType", v.SQLServerLicenseType) @@ -20845,6 +22780,7 @@ func (v VMwareCbtEnableMigrationInput) MarshalJSON() ([]byte, error) { populate(objectMap, "targetVmTags", v.TargetVMTags) populate(objectMap, "testNetworkId", v.TestNetworkID) populate(objectMap, "testSubnetName", v.TestSubnetName) + populate(objectMap, "userSelectedOSName", v.UserSelectedOSName) populate(objectMap, "vmwareMachineId", v.VmwareMachineID) return json.Marshal(objectMap) } @@ -20873,6 +22809,9 @@ func (v *VMwareCbtEnableMigrationInput) UnmarshalJSON(data []byte) error { case "licenseType": err = unpopulate(val, "LicenseType", &v.LicenseType) delete(rawMsg, key) + case "linuxLicenseType": + err = unpopulate(val, "LinuxLicenseType", &v.LinuxLicenseType) + delete(rawMsg, key) case "performAutoResync": err = unpopulate(val, "PerformAutoResync", &v.PerformAutoResync) delete(rawMsg, key) @@ -20933,6 +22872,9 @@ func (v *VMwareCbtEnableMigrationInput) UnmarshalJSON(data []byte) error { case "testSubnetName": err = unpopulate(val, "TestSubnetName", &v.TestSubnetName) delete(rawMsg, key) + case "userSelectedOSName": + err = unpopulate(val, "UserSelectedOSName", &v.UserSelectedOSName) + delete(rawMsg, key) case "vmwareMachineId": err = unpopulate(val, "VmwareMachineID", &v.VmwareMachineID) delete(rawMsg, key) @@ -20981,6 +22923,7 @@ func (v VMwareCbtMigrateInput) MarshalJSON() ([]byte, error) { objectMap["instanceType"] = "VMwareCbt" populate(objectMap, "osUpgradeVersion", v.OSUpgradeVersion) populate(objectMap, "performShutdown", v.PerformShutdown) + populate(objectMap, "postMigrationSteps", v.PostMigrationSteps) return json.Marshal(objectMap) } @@ -21002,6 +22945,9 @@ func (v *VMwareCbtMigrateInput) UnmarshalJSON(data []byte) error { case "performShutdown": err = unpopulate(val, "PerformShutdown", &v.PerformShutdown) delete(rawMsg, key) + case "postMigrationSteps": + err = unpopulate(val, "PostMigrationSteps", &v.PostMigrationSteps) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", v, err) @@ -21027,6 +22973,7 @@ func (v VMwareCbtMigrationDetails) MarshalJSON() ([]byte, error) { populate(objectMap, "lastRecoveryPointId", v.LastRecoveryPointID) populateDateTimeRFC3339(objectMap, "lastRecoveryPointReceived", v.LastRecoveryPointReceived) populate(objectMap, "licenseType", v.LicenseType) + populate(objectMap, "linuxLicenseType", v.LinuxLicenseType) populate(objectMap, "migrationProgressPercentage", v.MigrationProgressPercentage) populate(objectMap, "migrationRecoveryPointId", v.MigrationRecoveryPointID) populate(objectMap, "osName", v.OSName) @@ -21116,6 +23063,9 @@ func (v *VMwareCbtMigrationDetails) UnmarshalJSON(data []byte) error { case "licenseType": err = unpopulate(val, "LicenseType", &v.LicenseType) delete(rawMsg, key) + case "linuxLicenseType": + err = unpopulate(val, "LinuxLicenseType", &v.LinuxLicenseType) + delete(rawMsg, key) case "migrationProgressPercentage": err = unpopulate(val, "MigrationProgressPercentage", &v.MigrationProgressPercentage) delete(rawMsg, key) @@ -21410,16 +23360,20 @@ func (v VMwareCbtProtectedDiskDetails) MarshalJSON() ([]byte, error) { populate(objectMap, "diskId", v.DiskID) populate(objectMap, "diskName", v.DiskName) populate(objectMap, "diskPath", v.DiskPath) + populate(objectMap, "diskSizeInGB", v.DiskSizeInGB) populate(objectMap, "diskType", v.DiskType) populate(objectMap, "gatewayOperationDetails", v.GatewayOperationDetails) + populate(objectMap, "iops", v.Iops) populate(objectMap, "isOSDisk", v.IsOSDisk) populate(objectMap, "logStorageAccountId", v.LogStorageAccountID) populate(objectMap, "logStorageAccountSasSecretName", v.LogStorageAccountSasSecretName) + populate(objectMap, "sectorSizeInBytes", v.SectorSizeInBytes) populate(objectMap, "seedBlobUri", v.SeedBlobURI) populate(objectMap, "seedManagedDiskId", v.SeedManagedDiskID) populate(objectMap, "targetBlobUri", v.TargetBlobURI) populate(objectMap, "targetDiskName", v.TargetDiskName) populate(objectMap, "targetManagedDiskId", v.TargetManagedDiskID) + populate(objectMap, "throughputInMbps", v.ThroughputInMbps) return json.Marshal(objectMap) } @@ -21447,12 +23401,18 @@ func (v *VMwareCbtProtectedDiskDetails) UnmarshalJSON(data []byte) error { case "diskPath": err = unpopulate(val, "DiskPath", &v.DiskPath) delete(rawMsg, key) + case "diskSizeInGB": + err = unpopulate(val, "DiskSizeInGB", &v.DiskSizeInGB) + delete(rawMsg, key) case "diskType": err = unpopulate(val, "DiskType", &v.DiskType) delete(rawMsg, key) case "gatewayOperationDetails": err = unpopulate(val, "GatewayOperationDetails", &v.GatewayOperationDetails) delete(rawMsg, key) + case "iops": + err = unpopulate(val, "Iops", &v.Iops) + delete(rawMsg, key) case "isOSDisk": err = unpopulate(val, "IsOSDisk", &v.IsOSDisk) delete(rawMsg, key) @@ -21462,6 +23422,9 @@ func (v *VMwareCbtProtectedDiskDetails) UnmarshalJSON(data []byte) error { case "logStorageAccountSasSecretName": err = unpopulate(val, "LogStorageAccountSasSecretName", &v.LogStorageAccountSasSecretName) delete(rawMsg, key) + case "sectorSizeInBytes": + err = unpopulate(val, "SectorSizeInBytes", &v.SectorSizeInBytes) + delete(rawMsg, key) case "seedBlobUri": err = unpopulate(val, "SeedBlobURI", &v.SeedBlobURI) delete(rawMsg, key) @@ -21477,6 +23440,9 @@ func (v *VMwareCbtProtectedDiskDetails) UnmarshalJSON(data []byte) error { case "targetManagedDiskId": err = unpopulate(val, "TargetManagedDiskID", &v.TargetManagedDiskID) delete(rawMsg, key) + case "throughputInMbps": + err = unpopulate(val, "ThroughputInMbps", &v.ThroughputInMbps) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", v, err) @@ -21655,6 +23621,7 @@ func (v VMwareCbtTestMigrateInput) MarshalJSON() ([]byte, error) { objectMap["instanceType"] = "VMwareCbt" populate(objectMap, "networkId", v.NetworkID) populate(objectMap, "osUpgradeVersion", v.OSUpgradeVersion) + populate(objectMap, "postMigrationSteps", v.PostMigrationSteps) populate(objectMap, "recoveryPointId", v.RecoveryPointID) populate(objectMap, "vmNics", v.VMNics) return json.Marshal(objectMap) @@ -21678,6 +23645,9 @@ func (v *VMwareCbtTestMigrateInput) UnmarshalJSON(data []byte) error { case "osUpgradeVersion": err = unpopulate(val, "OSUpgradeVersion", &v.OSUpgradeVersion) delete(rawMsg, key) + case "postMigrationSteps": + err = unpopulate(val, "PostMigrationSteps", &v.PostMigrationSteps) + delete(rawMsg, key) case "recoveryPointId": err = unpopulate(val, "RecoveryPointID", &v.RecoveryPointID) delete(rawMsg, key) @@ -21696,8 +23666,11 @@ func (v *VMwareCbtTestMigrateInput) UnmarshalJSON(data []byte) error { func (v VMwareCbtUpdateDiskInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "diskId", v.DiskID) + populate(objectMap, "diskSizeInGB", v.DiskSizeInGB) + populate(objectMap, "iops", v.Iops) populate(objectMap, "isOSDisk", v.IsOSDisk) populate(objectMap, "targetDiskName", v.TargetDiskName) + populate(objectMap, "throughputInMbps", v.ThroughputInMbps) return json.Marshal(objectMap) } @@ -21713,12 +23686,21 @@ func (v *VMwareCbtUpdateDiskInput) UnmarshalJSON(data []byte) error { case "diskId": err = unpopulate(val, "DiskID", &v.DiskID) delete(rawMsg, key) + case "diskSizeInGB": + err = unpopulate(val, "DiskSizeInGB", &v.DiskSizeInGB) + delete(rawMsg, key) + case "iops": + err = unpopulate(val, "Iops", &v.Iops) + delete(rawMsg, key) case "isOSDisk": err = unpopulate(val, "IsOSDisk", &v.IsOSDisk) delete(rawMsg, key) case "targetDiskName": err = unpopulate(val, "TargetDiskName", &v.TargetDiskName) delete(rawMsg, key) + case "throughputInMbps": + err = unpopulate(val, "ThroughputInMbps", &v.ThroughputInMbps) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", v, err) @@ -21732,6 +23714,7 @@ func (v VMwareCbtUpdateMigrationItemInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["instanceType"] = "VMwareCbt" populate(objectMap, "licenseType", v.LicenseType) + populate(objectMap, "linuxLicenseType", v.LinuxLicenseType) populate(objectMap, "performAutoResync", v.PerformAutoResync) populate(objectMap, "sqlServerLicenseType", v.SQLServerLicenseType) populate(objectMap, "targetAvailabilitySetId", v.TargetAvailabilitySetID) @@ -21746,6 +23729,7 @@ func (v VMwareCbtUpdateMigrationItemInput) MarshalJSON() ([]byte, error) { populate(objectMap, "targetVmSize", v.TargetVMSize) populate(objectMap, "targetVmTags", v.TargetVMTags) populate(objectMap, "testNetworkId", v.TestNetworkID) + populate(objectMap, "userSelectedOSName", v.UserSelectedOSName) populate(objectMap, "vmDisks", v.VMDisks) populate(objectMap, "vmNics", v.VMNics) return json.Marshal(objectMap) @@ -21766,6 +23750,9 @@ func (v *VMwareCbtUpdateMigrationItemInput) UnmarshalJSON(data []byte) error { case "licenseType": err = unpopulate(val, "LicenseType", &v.LicenseType) delete(rawMsg, key) + case "linuxLicenseType": + err = unpopulate(val, "LinuxLicenseType", &v.LinuxLicenseType) + delete(rawMsg, key) case "performAutoResync": err = unpopulate(val, "PerformAutoResync", &v.PerformAutoResync) delete(rawMsg, key) @@ -21808,6 +23795,9 @@ func (v *VMwareCbtUpdateMigrationItemInput) UnmarshalJSON(data []byte) error { case "testNetworkId": err = unpopulate(val, "TestNetworkID", &v.TestNetworkID) delete(rawMsg, key) + case "userSelectedOSName": + err = unpopulate(val, "UserSelectedOSName", &v.UserSelectedOSName) + delete(rawMsg, key) case "vmDisks": err = unpopulate(val, "VMDisks", &v.VMDisks) delete(rawMsg, key) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/operations_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/operations_client.go index 5de90c8404b9..c88b471ac904 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/operations_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/operations_client.go @@ -45,7 +45,7 @@ func NewOperationsClient(subscriptionID string, credential azcore.TokenCredentia // NewListPager - Operation to return the list of available operations. // -// Generated from API version 2023-08-01 +// Generated from API version 2025-01-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] { @@ -87,7 +87,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-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 1e25a4c1181d..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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 index 7c54eda3104b..2330d302ec4d 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/options.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/options.go @@ -8,6 +8,17 @@ package armrecoveryservicessiterecovery +// ClusterRecoveryPointClientGetOptions contains the optional parameters for the ClusterRecoveryPointClient.Get method. +type ClusterRecoveryPointClientGetOptions struct { + // placeholder for future optional parameters +} + +// ClusterRecoveryPointsClientListByReplicationProtectionClusterOptions contains the optional parameters for the ClusterRecoveryPointsClient.NewListByReplicationProtectionClusterPager +// method. +type ClusterRecoveryPointsClientListByReplicationProtectionClusterOptions struct { + // placeholder for future optional parameters +} + // MigrationRecoveryPointsClientGetOptions contains the optional parameters for the MigrationRecoveryPointsClient.Get method. type MigrationRecoveryPointsClientGetOptions struct { // placeholder for future optional parameters @@ -554,6 +565,90 @@ type ReplicationProtectedItemsClientListOptions struct { SkipToken *string } +// ReplicationProtectionClustersClientBeginApplyRecoveryPointOptions contains the optional parameters for the ReplicationProtectionClustersClient.BeginApplyRecoveryPoint +// method. +type ReplicationProtectionClustersClientBeginApplyRecoveryPointOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectionClustersClientBeginCreateOptions contains the optional parameters for the ReplicationProtectionClustersClient.BeginCreate +// method. +type ReplicationProtectionClustersClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectionClustersClientBeginFailoverCommitOptions contains the optional parameters for the ReplicationProtectionClustersClient.BeginFailoverCommit +// method. +type ReplicationProtectionClustersClientBeginFailoverCommitOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectionClustersClientBeginPurgeOptions contains the optional parameters for the ReplicationProtectionClustersClient.BeginPurge +// method. +type ReplicationProtectionClustersClientBeginPurgeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectionClustersClientBeginRepairReplicationOptions contains the optional parameters for the ReplicationProtectionClustersClient.BeginRepairReplication +// method. +type ReplicationProtectionClustersClientBeginRepairReplicationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectionClustersClientBeginTestFailoverCleanupOptions contains the optional parameters for the ReplicationProtectionClustersClient.BeginTestFailoverCleanup +// method. +type ReplicationProtectionClustersClientBeginTestFailoverCleanupOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectionClustersClientBeginTestFailoverOptions contains the optional parameters for the ReplicationProtectionClustersClient.BeginTestFailover +// method. +type ReplicationProtectionClustersClientBeginTestFailoverOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectionClustersClientBeginUnplannedFailoverOptions contains the optional parameters for the ReplicationProtectionClustersClient.BeginUnplannedFailover +// method. +type ReplicationProtectionClustersClientBeginUnplannedFailoverOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ReplicationProtectionClustersClientGetOperationResultsOptions contains the optional parameters for the ReplicationProtectionClustersClient.GetOperationResults +// method. +type ReplicationProtectionClustersClientGetOperationResultsOptions struct { + // placeholder for future optional parameters +} + +// ReplicationProtectionClustersClientGetOptions contains the optional parameters for the ReplicationProtectionClustersClient.Get +// method. +type ReplicationProtectionClustersClientGetOptions struct { + // placeholder for future optional parameters +} + +// ReplicationProtectionClustersClientListByReplicationProtectionContainersOptions contains the optional parameters for the +// ReplicationProtectionClustersClient.NewListByReplicationProtectionContainersPager method. +type ReplicationProtectionClustersClientListByReplicationProtectionContainersOptions struct { + // placeholder for future optional parameters +} + +// ReplicationProtectionClustersClientListOptions contains the optional parameters for the ReplicationProtectionClustersClient.NewListPager +// method. +type ReplicationProtectionClustersClientListOptions 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 { @@ -621,6 +716,13 @@ type ReplicationProtectionContainersClientBeginDiscoverProtectableItemOptions st ResumeToken string } +// ReplicationProtectionContainersClientBeginSwitchClusterProtectionOptions contains the optional parameters for the ReplicationProtectionContainersClient.BeginSwitchClusterProtection +// method. +type ReplicationProtectionContainersClientBeginSwitchClusterProtectionOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ReplicationProtectionContainersClientBeginSwitchProtectionOptions contains the optional parameters for the ReplicationProtectionContainersClient.BeginSwitchProtection // method. type ReplicationProtectionContainersClientBeginSwitchProtectionOptions struct { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/polymorphic_helpers.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/polymorphic_helpers.go index b88b0b5defc7..4b16f03241a4 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/polymorphic_helpers.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/polymorphic_helpers.go @@ -22,6 +22,8 @@ func unmarshalAddDisksProviderSpecificInputClassification(rawMsg json.RawMessage switch m["instanceType"] { case "A2A": b = &A2AAddDisksInput{} + case "InMageRcm": + b = &InMageRcmAddDisksInput{} default: b = &AddDisksProviderSpecificInput{} } @@ -52,6 +54,27 @@ func unmarshalApplianceSpecificDetailsClassification(rawMsg json.RawMessage) (Ap return b, nil } +func unmarshalApplyClusterRecoveryPointProviderSpecificInputClassification(rawMsg json.RawMessage) (ApplyClusterRecoveryPointProviderSpecificInputClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b ApplyClusterRecoveryPointProviderSpecificInputClassification + switch m["instanceType"] { + case "A2A": + b = &A2AApplyClusterRecoveryPointInput{} + default: + b = &ApplyClusterRecoveryPointProviderSpecificInput{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + func unmarshalApplyRecoveryPointProviderSpecificInputClassification(rawMsg json.RawMessage) (ApplyRecoveryPointProviderSpecificInputClassification, error) { if rawMsg == nil || string(rawMsg) == "null" { return nil, nil @@ -81,6 +104,69 @@ func unmarshalApplyRecoveryPointProviderSpecificInputClassification(rawMsg json. return b, nil } +func unmarshalClusterProviderSpecificRecoveryPointDetailsClassification(rawMsg json.RawMessage) (ClusterProviderSpecificRecoveryPointDetailsClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b ClusterProviderSpecificRecoveryPointDetailsClassification + switch m["instanceType"] { + case "A2A": + b = &A2AClusterRecoveryPointDetails{} + default: + b = &ClusterProviderSpecificRecoveryPointDetails{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalClusterTestFailoverProviderSpecificInputClassification(rawMsg json.RawMessage) (ClusterTestFailoverProviderSpecificInputClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b ClusterTestFailoverProviderSpecificInputClassification + switch m["instanceType"] { + case "A2A": + b = &A2AClusterTestFailoverInput{} + default: + b = &ClusterTestFailoverProviderSpecificInput{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalClusterUnplannedFailoverProviderSpecificInputClassification(rawMsg json.RawMessage) (ClusterUnplannedFailoverProviderSpecificInputClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b ClusterUnplannedFailoverProviderSpecificInputClassification + switch m["instanceType"] { + case "A2A": + b = &A2AClusterUnplannedFailoverInput{} + default: + b = &ClusterUnplannedFailoverProviderSpecificInput{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + func unmarshalConfigurationSettingsClassification(rawMsg json.RawMessage) (ConfigurationSettingsClassification, error) { if rawMsg == nil || string(rawMsg) == "null" { return nil, nil @@ -403,6 +489,12 @@ func unmarshalJobDetailsClassification(rawMsg json.RawMessage) (JobDetailsClassi switch m["instanceType"] { case "AsrJobDetails": b = &AsrJobDetails{} + case "ClusterFailoverJobDetails": + b = &ClusterFailoverJobDetails{} + case "ClusterSwitchProtectionJobDetails": + b = &ClusterSwitchProtectionJobDetails{} + case "ClusterTestFailoverJobDetails": + b = &ClusterTestFailoverJobDetails{} case "ExportJobDetails": b = &ExportJobDetails{} case "FailoverJobDetails": @@ -929,6 +1021,27 @@ func unmarshalRemoveDisksProviderSpecificInputClassification(rawMsg json.RawMess return b, nil } +func unmarshalReplicationClusterProviderSpecificSettingsClassification(rawMsg json.RawMessage) (ReplicationClusterProviderSpecificSettingsClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b ReplicationClusterProviderSpecificSettingsClassification + switch m["instanceType"] { + case "A2A": + b = &A2AReplicationProtectionClusterDetails{} + default: + b = &ReplicationClusterProviderSpecificSettings{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + func unmarshalReplicationProtectionIntentProviderSpecificSettingsClassification(rawMsg json.RawMessage) (ReplicationProtectionIntentProviderSpecificSettingsClassification, error) { if rawMsg == nil || string(rawMsg) == "null" { return nil, nil @@ -1152,6 +1265,27 @@ func unmarshalReverseReplicationProviderSpecificInputClassification(rawMsg json. return b, nil } +func unmarshalSharedDiskReplicationProviderSpecificSettingsClassification(rawMsg json.RawMessage) (SharedDiskReplicationProviderSpecificSettingsClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b SharedDiskReplicationProviderSpecificSettingsClassification + switch m["instanceType"] { + case "A2A": + b = &A2ASharedDiskReplicationDetails{} + default: + b = &SharedDiskReplicationProviderSpecificSettings{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + func unmarshalStorageAccountCustomDetailsClassification(rawMsg json.RawMessage) (StorageAccountCustomDetailsClassification, error) { if rawMsg == nil || string(rawMsg) == "null" { return nil, nil @@ -1173,6 +1307,27 @@ func unmarshalStorageAccountCustomDetailsClassification(rawMsg json.RawMessage) return b, nil } +func unmarshalSwitchClusterProtectionProviderSpecificInputClassification(rawMsg json.RawMessage) (SwitchClusterProtectionProviderSpecificInputClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b SwitchClusterProtectionProviderSpecificInputClassification + switch m["instanceType"] { + case "A2A": + b = &A2ASwitchClusterProtectionInput{} + default: + b = &SwitchClusterProtectionProviderSpecificInput{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + func unmarshalSwitchProtectionProviderSpecificInputClassification(rawMsg json.RawMessage) (SwitchProtectionProviderSpecificInputClassification, error) { if rawMsg == nil || string(rawMsg) == "null" { return nil, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/recoverypoints_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/recoverypoints_client.go index d01885f135c2..97fab711185a 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/recoverypoints_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/recoverypoints_client.go @@ -46,21 +46,21 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - The fabric name. // - protectionContainerName - The protection container name. // - replicatedProtectedItemName - The replication protected item name. // - 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) { +func (client *RecoveryPointsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string, options *RecoveryPointsClientGetOptions) (RecoveryPointsClientGetResponse, error) { var err error const operationName = "RecoveryPointsClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, recoveryPointName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, recoveryPointName, options) if err != nil { return RecoveryPointsClientGetResponse{}, err } @@ -77,16 +77,16 @@ func (client *RecoveryPointsClient) Get(ctx context.Context, resourceName string } // getCreateRequest creates the Get request. -func (client *RecoveryPointsClient) getCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string, options *RecoveryPointsClientGetOptions) (*policy.Request, error) { +func (client *RecoveryPointsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, recoveryPointName string, options *RecoveryPointsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints/{recoveryPointName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -112,7 +112,7 @@ func (client *RecoveryPointsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -129,15 +129,15 @@ func (client *RecoveryPointsClient) getHandleResponse(resp *http.Response) (Reco // NewListByReplicationProtectedItemsPager - Lists the available recovery points for a replication protected item. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - The fabric name. // - protectionContainerName - The protection container name. // - replicatedProtectedItemName - The replication protected item name. // - options - RecoveryPointsClientListByReplicationProtectedItemsOptions contains the optional parameters for the RecoveryPointsClient.NewListByReplicationProtectedItemsPager // method. -func (client *RecoveryPointsClient) NewListByReplicationProtectedItemsPager(resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *RecoveryPointsClientListByReplicationProtectedItemsOptions) *runtime.Pager[RecoveryPointsClientListByReplicationProtectedItemsResponse] { +func (client *RecoveryPointsClient) NewListByReplicationProtectedItemsPager(resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *RecoveryPointsClientListByReplicationProtectedItemsOptions) *runtime.Pager[RecoveryPointsClientListByReplicationProtectedItemsResponse] { return runtime.NewPager(runtime.PagingHandler[RecoveryPointsClientListByReplicationProtectedItemsResponse]{ More: func(page RecoveryPointsClientListByReplicationProtectedItemsResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -149,7 +149,7 @@ func (client *RecoveryPointsClient) NewListByReplicationProtectedItemsPager(reso nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByReplicationProtectedItemsCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, options) + return client.listByReplicationProtectedItemsCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, options) }, nil) if err != nil { return RecoveryPointsClientListByReplicationProtectedItemsResponse{}, err @@ -161,16 +161,16 @@ func (client *RecoveryPointsClient) NewListByReplicationProtectedItemsPager(reso } // listByReplicationProtectedItemsCreateRequest creates the ListByReplicationProtectedItems request. -func (client *RecoveryPointsClient) listByReplicationProtectedItemsCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *RecoveryPointsClientListByReplicationProtectedItemsOptions) (*policy.Request, error) { +func (client *RecoveryPointsClient) listByReplicationProtectedItemsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *RecoveryPointsClientListByReplicationProtectedItemsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -192,7 +192,7 @@ func (client *RecoveryPointsClient) listByReplicationProtectedItemsCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-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 130532be7a6f..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.808Z"); 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.972Z"); return t}()), - // RecoveryPointType: to.Ptr("CrashConsistent"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.808Z"); 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 9b4e00aa7f23..ba43241fa593 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationalertsettings_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationalertsettings_client.go @@ -46,20 +46,20 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - alertSettingName - The name of the email notification(alert) configuration. // - request - The input to configure the email notification(alert). // - 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) { +func (client *ReplicationAlertSettingsClient) Create(ctx context.Context, resourceGroupName string, resourceName string, alertSettingName string, request ConfigureAlertRequest, options *ReplicationAlertSettingsClientCreateOptions) (ReplicationAlertSettingsClientCreateResponse, error) { var err error const operationName = "ReplicationAlertSettingsClient.Create" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, alertSettingName, request, options) + req, err := client.createCreateRequest(ctx, resourceGroupName, resourceName, alertSettingName, request, options) if err != nil { return ReplicationAlertSettingsClientCreateResponse{}, err } @@ -76,16 +76,16 @@ func (client *ReplicationAlertSettingsClient) Create(ctx context.Context, resour } // createCreateRequest creates the Create request. -func (client *ReplicationAlertSettingsClient) createCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, alertSettingName string, request ConfigureAlertRequest, options *ReplicationAlertSettingsClientCreateOptions) (*policy.Request, error) { +func (client *ReplicationAlertSettingsClient) createCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, alertSettingName string, request ConfigureAlertRequest, options *ReplicationAlertSettingsClientCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -99,7 +99,7 @@ func (client *ReplicationAlertSettingsClient) createCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, request); err != nil { @@ -120,19 +120,19 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - 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) { +func (client *ReplicationAlertSettingsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, alertSettingName string, options *ReplicationAlertSettingsClientGetOptions) (ReplicationAlertSettingsClientGetResponse, error) { var err error const operationName = "ReplicationAlertSettingsClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, alertSettingName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, alertSettingName, options) if err != nil { return ReplicationAlertSettingsClientGetResponse{}, err } @@ -149,16 +149,16 @@ func (client *ReplicationAlertSettingsClient) Get(ctx context.Context, resourceN } // getCreateRequest creates the Get request. -func (client *ReplicationAlertSettingsClient) getCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, alertSettingName string, options *ReplicationAlertSettingsClientGetOptions) (*policy.Request, error) { +func (client *ReplicationAlertSettingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, alertSettingName string, options *ReplicationAlertSettingsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -172,7 +172,7 @@ func (client *ReplicationAlertSettingsClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -189,12 +189,12 @@ func (client *ReplicationAlertSettingsClient) getHandleResponse(resp *http.Respo // NewListPager - Gets the list of email notification(alert) configurations for the vault. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - options - ReplicationAlertSettingsClientListOptions contains the optional parameters for the ReplicationAlertSettingsClient.NewListPager // method. -func (client *ReplicationAlertSettingsClient) NewListPager(resourceName string, resourceGroupName string, options *ReplicationAlertSettingsClientListOptions) *runtime.Pager[ReplicationAlertSettingsClientListResponse] { +func (client *ReplicationAlertSettingsClient) NewListPager(resourceGroupName string, resourceName string, options *ReplicationAlertSettingsClientListOptions) *runtime.Pager[ReplicationAlertSettingsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationAlertSettingsClientListResponse]{ More: func(page ReplicationAlertSettingsClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -206,7 +206,7 @@ func (client *ReplicationAlertSettingsClient) NewListPager(resourceName string, nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceName, resourceGroupName, options) + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) }, nil) if err != nil { return ReplicationAlertSettingsClientListResponse{}, err @@ -218,16 +218,16 @@ func (client *ReplicationAlertSettingsClient) NewListPager(resourceName string, } // listCreateRequest creates the List request. -func (client *ReplicationAlertSettingsClient) listCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, options *ReplicationAlertSettingsClientListOptions) (*policy.Request, error) { +func (client *ReplicationAlertSettingsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicationAlertSettingsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -237,7 +237,7 @@ func (client *ReplicationAlertSettingsClient) listCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-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 2684f79fc7d6..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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 8e963274fa63..a80454b472f2 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationappliances_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationappliances_client.go @@ -45,12 +45,12 @@ func NewReplicationAppliancesClient(subscriptionID string, credential azcore.Tok // NewListPager - Gets the list of Azure Site Recovery appliances for the vault. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - options - ReplicationAppliancesClientListOptions contains the optional parameters for the ReplicationAppliancesClient.NewListPager // method. -func (client *ReplicationAppliancesClient) NewListPager(resourceName string, resourceGroupName string, options *ReplicationAppliancesClientListOptions) *runtime.Pager[ReplicationAppliancesClientListResponse] { +func (client *ReplicationAppliancesClient) NewListPager(resourceGroupName string, resourceName string, options *ReplicationAppliancesClientListOptions) *runtime.Pager[ReplicationAppliancesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationAppliancesClientListResponse]{ More: func(page ReplicationAppliancesClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -62,7 +62,7 @@ func (client *ReplicationAppliancesClient) NewListPager(resourceName string, res nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceName, resourceGroupName, options) + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) }, nil) if err != nil { return ReplicationAppliancesClientListResponse{}, err @@ -74,16 +74,16 @@ func (client *ReplicationAppliancesClient) NewListPager(resourceName string, res } // listCreateRequest creates the List request. -func (client *ReplicationAppliancesClient) listCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, options *ReplicationAppliancesClientListOptions) (*policy.Request, error) { +func (client *ReplicationAppliancesClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicationAppliancesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAppliances" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -96,7 +96,7 @@ func (client *ReplicationAppliancesClient) listCreateRequest(ctx context.Context if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil 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 3d08dac27667..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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 46ccb08de573..f7433ac06576 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationeligibilityresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationeligibilityresults_client.go @@ -46,7 +46,7 @@ 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 2023-08-01 +// Generated from API version 2025-01-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 @@ -93,7 +93,7 @@ func (client *ReplicationEligibilityResultsClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -111,7 +111,7 @@ 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 2023-08-01 +// Generated from API version 2025-01-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 @@ -158,7 +158,7 @@ func (client *ReplicationEligibilityResultsClient) listCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-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 3f0da24c87fd..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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 a89a13f4e16a..62df1c330409 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationevents_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationevents_client.go @@ -46,18 +46,18 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - 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) { +func (client *ReplicationEventsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, eventName string, options *ReplicationEventsClientGetOptions) (ReplicationEventsClientGetResponse, error) { var err error const operationName = "ReplicationEventsClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, eventName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, eventName, options) if err != nil { return ReplicationEventsClientGetResponse{}, err } @@ -74,16 +74,16 @@ func (client *ReplicationEventsClient) Get(ctx context.Context, resourceName str } // getCreateRequest creates the Get request. -func (client *ReplicationEventsClient) getCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, eventName string, options *ReplicationEventsClientGetOptions) (*policy.Request, error) { +func (client *ReplicationEventsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, eventName string, options *ReplicationEventsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents/{eventName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -97,7 +97,7 @@ func (client *ReplicationEventsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,12 +114,12 @@ func (client *ReplicationEventsClient) getHandleResponse(resp *http.Response) (R // NewListPager - Gets the list of Azure Site Recovery events for the vault. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - options - ReplicationEventsClientListOptions contains the optional parameters for the ReplicationEventsClient.NewListPager // method. -func (client *ReplicationEventsClient) NewListPager(resourceName string, resourceGroupName string, options *ReplicationEventsClientListOptions) *runtime.Pager[ReplicationEventsClientListResponse] { +func (client *ReplicationEventsClient) NewListPager(resourceGroupName string, resourceName string, options *ReplicationEventsClientListOptions) *runtime.Pager[ReplicationEventsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationEventsClientListResponse]{ More: func(page ReplicationEventsClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -131,7 +131,7 @@ func (client *ReplicationEventsClient) NewListPager(resourceName string, resourc nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceName, resourceGroupName, options) + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) }, nil) if err != nil { return ReplicationEventsClientListResponse{}, err @@ -143,16 +143,16 @@ func (client *ReplicationEventsClient) NewListPager(resourceName string, resourc } // listCreateRequest creates the List request. -func (client *ReplicationEventsClient) listCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, options *ReplicationEventsClientListOptions) (*policy.Request, error) { +func (client *ReplicationEventsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicationEventsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -165,7 +165,7 @@ func (client *ReplicationEventsClient) listCreateRequest(ctx context.Context, re if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil 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 7fe5ae0878dc..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.070Z"); 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.507Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.507Z"); return t}()), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationfabrics_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationfabrics_client.go index 0f0d80e9514f..7619b5a39e61 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationfabrics_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationfabrics_client.go @@ -46,15 +46,15 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - options - ReplicationFabricsClientBeginCheckConsistencyOptions contains the optional parameters for the ReplicationFabricsClient.BeginCheckConsistency // method. -func (client *ReplicationFabricsClient) BeginCheckConsistency(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *ReplicationFabricsClientBeginCheckConsistencyOptions) (*runtime.Poller[ReplicationFabricsClientCheckConsistencyResponse], error) { +func (client *ReplicationFabricsClient) BeginCheckConsistency(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *ReplicationFabricsClientBeginCheckConsistencyOptions) (*runtime.Poller[ReplicationFabricsClientCheckConsistencyResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.checkConsistency(ctx, resourceName, resourceGroupName, fabricName, options) + resp, err := client.checkConsistency(ctx, resourceGroupName, resourceName, fabricName, options) if err != nil { return nil, err } @@ -72,14 +72,14 @@ 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 2023-08-01 -func (client *ReplicationFabricsClient) checkConsistency(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *ReplicationFabricsClientBeginCheckConsistencyOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationFabricsClient) checkConsistency(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *ReplicationFabricsClientBeginCheckConsistencyOptions) (*http.Response, error) { var err error const operationName = "ReplicationFabricsClient.BeginCheckConsistency" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.checkConsistencyCreateRequest(ctx, resourceName, resourceGroupName, fabricName, options) + req, err := client.checkConsistencyCreateRequest(ctx, resourceGroupName, resourceName, fabricName, options) if err != nil { return nil, err } @@ -95,16 +95,16 @@ func (client *ReplicationFabricsClient) checkConsistency(ctx context.Context, re } // checkConsistencyCreateRequest creates the CheckConsistency request. -func (client *ReplicationFabricsClient) checkConsistencyCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *ReplicationFabricsClientBeginCheckConsistencyOptions) (*policy.Request, error) { +func (client *ReplicationFabricsClient) checkConsistencyCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *ReplicationFabricsClientBeginCheckConsistencyOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/checkConsistency" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -118,7 +118,7 @@ func (client *ReplicationFabricsClient) checkConsistencyCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -127,16 +127,16 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Name of the ASR fabric. // - input - Fabric creation input. // - options - ReplicationFabricsClientBeginCreateOptions contains the optional parameters for the ReplicationFabricsClient.BeginCreate // method. -func (client *ReplicationFabricsClient) BeginCreate(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, input FabricCreationInput, options *ReplicationFabricsClientBeginCreateOptions) (*runtime.Poller[ReplicationFabricsClientCreateResponse], error) { +func (client *ReplicationFabricsClient) BeginCreate(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, input FabricCreationInput, options *ReplicationFabricsClientBeginCreateOptions) (*runtime.Poller[ReplicationFabricsClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceName, resourceGroupName, fabricName, input, options) + resp, err := client.create(ctx, resourceGroupName, resourceName, fabricName, input, options) if err != nil { return nil, err } @@ -154,14 +154,14 @@ 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 2023-08-01 -func (client *ReplicationFabricsClient) create(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, input FabricCreationInput, options *ReplicationFabricsClientBeginCreateOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationFabricsClient) create(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, input FabricCreationInput, options *ReplicationFabricsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "ReplicationFabricsClient.BeginCreate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, fabricName, input, options) + req, err := client.createCreateRequest(ctx, resourceGroupName, resourceName, fabricName, input, options) if err != nil { return nil, err } @@ -177,16 +177,16 @@ func (client *ReplicationFabricsClient) create(ctx context.Context, resourceName } // createCreateRequest creates the Create request. -func (client *ReplicationFabricsClient) createCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, input FabricCreationInput, options *ReplicationFabricsClientBeginCreateOptions) (*policy.Request, error) { +func (client *ReplicationFabricsClient) createCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, input FabricCreationInput, options *ReplicationFabricsClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -200,7 +200,7 @@ func (client *ReplicationFabricsClient) createCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, input); err != nil { @@ -212,15 +212,15 @@ func (client *ReplicationFabricsClient) createCreateRequest(ctx context.Context, // 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - ASR fabric to delete. // - options - ReplicationFabricsClientBeginDeleteOptions contains the optional parameters for the ReplicationFabricsClient.BeginDelete // method. -func (client *ReplicationFabricsClient) BeginDelete(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *ReplicationFabricsClientBeginDeleteOptions) (*runtime.Poller[ReplicationFabricsClientDeleteResponse], error) { +func (client *ReplicationFabricsClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *ReplicationFabricsClientBeginDeleteOptions) (*runtime.Poller[ReplicationFabricsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceName, resourceGroupName, fabricName, options) + resp, err := client.deleteOperation(ctx, resourceGroupName, resourceName, fabricName, options) if err != nil { return nil, err } @@ -238,14 +238,14 @@ 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 2023-08-01 -func (client *ReplicationFabricsClient) deleteOperation(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *ReplicationFabricsClientBeginDeleteOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationFabricsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *ReplicationFabricsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ReplicationFabricsClient.BeginDelete" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceName, resourceGroupName, fabricName, options) + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, fabricName, options) if err != nil { return nil, err } @@ -261,16 +261,16 @@ func (client *ReplicationFabricsClient) deleteOperation(ctx context.Context, res } // deleteCreateRequest creates the Delete request. -func (client *ReplicationFabricsClient) deleteCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *ReplicationFabricsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ReplicationFabricsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *ReplicationFabricsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/remove" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -284,7 +284,7 @@ func (client *ReplicationFabricsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -292,18 +292,18 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - 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) { +func (client *ReplicationFabricsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *ReplicationFabricsClientGetOptions) (ReplicationFabricsClientGetResponse, error) { var err error const operationName = "ReplicationFabricsClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, fabricName, options) if err != nil { return ReplicationFabricsClientGetResponse{}, err } @@ -320,16 +320,16 @@ func (client *ReplicationFabricsClient) Get(ctx context.Context, resourceName st } // getCreateRequest creates the Get request. -func (client *ReplicationFabricsClient) getCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *ReplicationFabricsClientGetOptions) (*policy.Request, error) { +func (client *ReplicationFabricsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *ReplicationFabricsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -346,7 +346,7 @@ func (client *ReplicationFabricsClient) getCreateRequest(ctx context.Context, re if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -363,12 +363,12 @@ func (client *ReplicationFabricsClient) getHandleResponse(resp *http.Response) ( // NewListPager - Gets a list of the Azure Site Recovery fabrics in the vault. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - options - ReplicationFabricsClientListOptions contains the optional parameters for the ReplicationFabricsClient.NewListPager // method. -func (client *ReplicationFabricsClient) NewListPager(resourceName string, resourceGroupName string, options *ReplicationFabricsClientListOptions) *runtime.Pager[ReplicationFabricsClientListResponse] { +func (client *ReplicationFabricsClient) NewListPager(resourceGroupName string, resourceName string, options *ReplicationFabricsClientListOptions) *runtime.Pager[ReplicationFabricsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationFabricsClientListResponse]{ More: func(page ReplicationFabricsClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -380,7 +380,7 @@ func (client *ReplicationFabricsClient) NewListPager(resourceName string, resour nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceName, resourceGroupName, options) + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) }, nil) if err != nil { return ReplicationFabricsClientListResponse{}, err @@ -392,16 +392,16 @@ func (client *ReplicationFabricsClient) NewListPager(resourceName string, resour } // listCreateRequest creates the List request. -func (client *ReplicationFabricsClient) listCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, options *ReplicationFabricsClientListOptions) (*policy.Request, error) { +func (client *ReplicationFabricsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicationFabricsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -411,7 +411,7 @@ func (client *ReplicationFabricsClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -429,15 +429,15 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - ASR fabric to migrate. // - options - ReplicationFabricsClientBeginMigrateToAADOptions contains the optional parameters for the ReplicationFabricsClient.BeginMigrateToAAD // method. -func (client *ReplicationFabricsClient) BeginMigrateToAAD(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *ReplicationFabricsClientBeginMigrateToAADOptions) (*runtime.Poller[ReplicationFabricsClientMigrateToAADResponse], error) { +func (client *ReplicationFabricsClient) BeginMigrateToAAD(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *ReplicationFabricsClientBeginMigrateToAADOptions) (*runtime.Poller[ReplicationFabricsClientMigrateToAADResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.migrateToAAD(ctx, resourceName, resourceGroupName, fabricName, options) + resp, err := client.migrateToAAD(ctx, resourceGroupName, resourceName, fabricName, options) if err != nil { return nil, err } @@ -455,14 +455,14 @@ 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 2023-08-01 -func (client *ReplicationFabricsClient) migrateToAAD(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *ReplicationFabricsClientBeginMigrateToAADOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationFabricsClient) migrateToAAD(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *ReplicationFabricsClientBeginMigrateToAADOptions) (*http.Response, error) { var err error const operationName = "ReplicationFabricsClient.BeginMigrateToAAD" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.migrateToAADCreateRequest(ctx, resourceName, resourceGroupName, fabricName, options) + req, err := client.migrateToAADCreateRequest(ctx, resourceGroupName, resourceName, fabricName, options) if err != nil { return nil, err } @@ -478,16 +478,16 @@ func (client *ReplicationFabricsClient) migrateToAAD(ctx context.Context, resour } // migrateToAADCreateRequest creates the MigrateToAAD request. -func (client *ReplicationFabricsClient) migrateToAADCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *ReplicationFabricsClientBeginMigrateToAADOptions) (*policy.Request, error) { +func (client *ReplicationFabricsClient) migrateToAADCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *ReplicationFabricsClientBeginMigrateToAADOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/migratetoaad" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -501,7 +501,7 @@ func (client *ReplicationFabricsClient) migrateToAADCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -509,15 +509,15 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - ASR fabric to purge. // - options - ReplicationFabricsClientBeginPurgeOptions contains the optional parameters for the ReplicationFabricsClient.BeginPurge // method. -func (client *ReplicationFabricsClient) BeginPurge(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *ReplicationFabricsClientBeginPurgeOptions) (*runtime.Poller[ReplicationFabricsClientPurgeResponse], error) { +func (client *ReplicationFabricsClient) BeginPurge(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *ReplicationFabricsClientBeginPurgeOptions) (*runtime.Poller[ReplicationFabricsClientPurgeResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.purge(ctx, resourceName, resourceGroupName, fabricName, options) + resp, err := client.purge(ctx, resourceGroupName, resourceName, fabricName, options) if err != nil { return nil, err } @@ -535,14 +535,14 @@ 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 2023-08-01 -func (client *ReplicationFabricsClient) purge(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *ReplicationFabricsClientBeginPurgeOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationFabricsClient) purge(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *ReplicationFabricsClientBeginPurgeOptions) (*http.Response, error) { var err error const operationName = "ReplicationFabricsClient.BeginPurge" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.purgeCreateRequest(ctx, resourceName, resourceGroupName, fabricName, options) + req, err := client.purgeCreateRequest(ctx, resourceGroupName, resourceName, fabricName, options) if err != nil { return nil, err } @@ -558,16 +558,16 @@ func (client *ReplicationFabricsClient) purge(ctx context.Context, resourceName } // purgeCreateRequest creates the Purge request. -func (client *ReplicationFabricsClient) purgeCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *ReplicationFabricsClientBeginPurgeOptions) (*policy.Request, error) { +func (client *ReplicationFabricsClient) purgeCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *ReplicationFabricsClientBeginPurgeOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -581,7 +581,7 @@ func (client *ReplicationFabricsClient) purgeCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -589,16 +589,16 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - The name of the fabric containing the process server. // - failoverProcessServerRequest - The input to the failover process server operation. // - options - ReplicationFabricsClientBeginReassociateGatewayOptions contains the optional parameters for the ReplicationFabricsClient.BeginReassociateGateway // method. -func (client *ReplicationFabricsClient) BeginReassociateGateway(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, failoverProcessServerRequest FailoverProcessServerRequest, options *ReplicationFabricsClientBeginReassociateGatewayOptions) (*runtime.Poller[ReplicationFabricsClientReassociateGatewayResponse], error) { +func (client *ReplicationFabricsClient) BeginReassociateGateway(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, failoverProcessServerRequest FailoverProcessServerRequest, options *ReplicationFabricsClientBeginReassociateGatewayOptions) (*runtime.Poller[ReplicationFabricsClientReassociateGatewayResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.reassociateGateway(ctx, resourceName, resourceGroupName, fabricName, failoverProcessServerRequest, options) + resp, err := client.reassociateGateway(ctx, resourceGroupName, resourceName, fabricName, failoverProcessServerRequest, options) if err != nil { return nil, err } @@ -616,14 +616,14 @@ 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 2023-08-01 -func (client *ReplicationFabricsClient) reassociateGateway(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, failoverProcessServerRequest FailoverProcessServerRequest, options *ReplicationFabricsClientBeginReassociateGatewayOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationFabricsClient) reassociateGateway(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, failoverProcessServerRequest FailoverProcessServerRequest, options *ReplicationFabricsClientBeginReassociateGatewayOptions) (*http.Response, error) { var err error const operationName = "ReplicationFabricsClient.BeginReassociateGateway" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.reassociateGatewayCreateRequest(ctx, resourceName, resourceGroupName, fabricName, failoverProcessServerRequest, options) + req, err := client.reassociateGatewayCreateRequest(ctx, resourceGroupName, resourceName, fabricName, failoverProcessServerRequest, options) if err != nil { return nil, err } @@ -639,16 +639,16 @@ func (client *ReplicationFabricsClient) reassociateGateway(ctx context.Context, } // reassociateGatewayCreateRequest creates the ReassociateGateway request. -func (client *ReplicationFabricsClient) reassociateGatewayCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, failoverProcessServerRequest FailoverProcessServerRequest, options *ReplicationFabricsClientBeginReassociateGatewayOptions) (*policy.Request, error) { +func (client *ReplicationFabricsClient) reassociateGatewayCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, failoverProcessServerRequest FailoverProcessServerRequest, options *ReplicationFabricsClientBeginReassociateGatewayOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/reassociateGateway" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -662,7 +662,7 @@ func (client *ReplicationFabricsClient) reassociateGatewayCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, failoverProcessServerRequest); err != nil { @@ -674,7 +674,7 @@ func (client *ReplicationFabricsClient) reassociateGatewayCreateRequest(ctx cont // BeginRemoveInfra - Removes the appliance's infrastructure under the fabric. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - resourceName - Resource name. // - fabricName - Fabric name. @@ -700,7 +700,7 @@ func (client *ReplicationFabricsClient) BeginRemoveInfra(ctx context.Context, re // RemoveInfra - Removes the appliance's infrastructure under the fabric. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 +// Generated from API version 2025-01-01 func (client *ReplicationFabricsClient) removeInfra(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *ReplicationFabricsClientBeginRemoveInfraOptions) (*http.Response, error) { var err error const operationName = "ReplicationFabricsClient.BeginRemoveInfra" @@ -746,7 +746,7 @@ func (client *ReplicationFabricsClient) removeInfraCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -755,16 +755,16 @@ func (client *ReplicationFabricsClient) removeInfraCreateRequest(ctx context.Con // BeginRenewCertificate - Renews the connection certificate for the ASR replication fabric. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - fabric name to renew certs for. // - renewCertificate - Renew certificate input. // - options - ReplicationFabricsClientBeginRenewCertificateOptions contains the optional parameters for the ReplicationFabricsClient.BeginRenewCertificate // method. -func (client *ReplicationFabricsClient) BeginRenewCertificate(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, renewCertificate RenewCertificateInput, options *ReplicationFabricsClientBeginRenewCertificateOptions) (*runtime.Poller[ReplicationFabricsClientRenewCertificateResponse], error) { +func (client *ReplicationFabricsClient) BeginRenewCertificate(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, renewCertificate RenewCertificateInput, options *ReplicationFabricsClientBeginRenewCertificateOptions) (*runtime.Poller[ReplicationFabricsClientRenewCertificateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.renewCertificate(ctx, resourceName, resourceGroupName, fabricName, renewCertificate, options) + resp, err := client.renewCertificate(ctx, resourceGroupName, resourceName, fabricName, renewCertificate, options) if err != nil { return nil, err } @@ -782,14 +782,14 @@ 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 2023-08-01 -func (client *ReplicationFabricsClient) renewCertificate(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, renewCertificate RenewCertificateInput, options *ReplicationFabricsClientBeginRenewCertificateOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationFabricsClient) renewCertificate(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, renewCertificate RenewCertificateInput, options *ReplicationFabricsClientBeginRenewCertificateOptions) (*http.Response, error) { var err error const operationName = "ReplicationFabricsClient.BeginRenewCertificate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.renewCertificateCreateRequest(ctx, resourceName, resourceGroupName, fabricName, renewCertificate, options) + req, err := client.renewCertificateCreateRequest(ctx, resourceGroupName, resourceName, fabricName, renewCertificate, options) if err != nil { return nil, err } @@ -805,16 +805,16 @@ func (client *ReplicationFabricsClient) renewCertificate(ctx context.Context, re } // renewCertificateCreateRequest creates the RenewCertificate request. -func (client *ReplicationFabricsClient) renewCertificateCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, renewCertificate RenewCertificateInput, options *ReplicationFabricsClientBeginRenewCertificateOptions) (*policy.Request, error) { +func (client *ReplicationFabricsClient) renewCertificateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, renewCertificate RenewCertificateInput, options *ReplicationFabricsClientBeginRenewCertificateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/renewCertificate" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -828,7 +828,7 @@ func (client *ReplicationFabricsClient) renewCertificateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, renewCertificate); err != 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 f5dc2d40d833..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationfabrics_client_example_test.go +++ /dev/null @@ -1,399 +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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationInfrastructure_Delete.json -func ExampleReplicationFabricsClient_BeginRemoveInfra() { - 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().BeginRemoveInfra(ctx, "resourceGroupPS1", "vault1", "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) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationjobs_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationjobs_client.go index f08f6a53fca8..0464e8562971 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationjobs_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationjobs_client.go @@ -46,15 +46,15 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - jobName - Job identifier. // - options - ReplicationJobsClientBeginCancelOptions contains the optional parameters for the ReplicationJobsClient.BeginCancel // method. -func (client *ReplicationJobsClient) BeginCancel(ctx context.Context, resourceName string, resourceGroupName string, jobName string, options *ReplicationJobsClientBeginCancelOptions) (*runtime.Poller[ReplicationJobsClientCancelResponse], error) { +func (client *ReplicationJobsClient) BeginCancel(ctx context.Context, resourceGroupName string, resourceName string, jobName string, options *ReplicationJobsClientBeginCancelOptions) (*runtime.Poller[ReplicationJobsClientCancelResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.cancel(ctx, resourceName, resourceGroupName, jobName, options) + resp, err := client.cancel(ctx, resourceGroupName, resourceName, jobName, options) if err != nil { return nil, err } @@ -72,14 +72,14 @@ 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 2023-08-01 -func (client *ReplicationJobsClient) cancel(ctx context.Context, resourceName string, resourceGroupName string, jobName string, options *ReplicationJobsClientBeginCancelOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationJobsClient) cancel(ctx context.Context, resourceGroupName string, resourceName string, jobName string, options *ReplicationJobsClientBeginCancelOptions) (*http.Response, error) { var err error const operationName = "ReplicationJobsClient.BeginCancel" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.cancelCreateRequest(ctx, resourceName, resourceGroupName, jobName, options) + req, err := client.cancelCreateRequest(ctx, resourceGroupName, resourceName, jobName, options) if err != nil { return nil, err } @@ -95,16 +95,16 @@ func (client *ReplicationJobsClient) cancel(ctx context.Context, resourceName st } // cancelCreateRequest creates the Cancel request. -func (client *ReplicationJobsClient) cancelCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, jobName string, options *ReplicationJobsClientBeginCancelOptions) (*policy.Request, error) { +func (client *ReplicationJobsClient) cancelCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, jobName string, options *ReplicationJobsClientBeginCancelOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/cancel" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -118,7 +118,7 @@ func (client *ReplicationJobsClient) cancelCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -127,15 +127,15 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - jobQueryParameter - job query filter. // - options - ReplicationJobsClientBeginExportOptions contains the optional parameters for the ReplicationJobsClient.BeginExport // method. -func (client *ReplicationJobsClient) BeginExport(ctx context.Context, resourceName string, resourceGroupName string, jobQueryParameter JobQueryParameter, options *ReplicationJobsClientBeginExportOptions) (*runtime.Poller[ReplicationJobsClientExportResponse], error) { +func (client *ReplicationJobsClient) BeginExport(ctx context.Context, resourceGroupName string, resourceName string, jobQueryParameter JobQueryParameter, options *ReplicationJobsClientBeginExportOptions) (*runtime.Poller[ReplicationJobsClientExportResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.export(ctx, resourceName, resourceGroupName, jobQueryParameter, options) + resp, err := client.export(ctx, resourceGroupName, resourceName, jobQueryParameter, options) if err != nil { return nil, err } @@ -153,14 +153,14 @@ 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 2023-08-01 -func (client *ReplicationJobsClient) export(ctx context.Context, resourceName string, resourceGroupName string, jobQueryParameter JobQueryParameter, options *ReplicationJobsClientBeginExportOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationJobsClient) export(ctx context.Context, resourceGroupName string, resourceName string, jobQueryParameter JobQueryParameter, options *ReplicationJobsClientBeginExportOptions) (*http.Response, error) { var err error const operationName = "ReplicationJobsClient.BeginExport" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.exportCreateRequest(ctx, resourceName, resourceGroupName, jobQueryParameter, options) + req, err := client.exportCreateRequest(ctx, resourceGroupName, resourceName, jobQueryParameter, options) if err != nil { return nil, err } @@ -176,16 +176,16 @@ func (client *ReplicationJobsClient) export(ctx context.Context, resourceName st } // exportCreateRequest creates the Export request. -func (client *ReplicationJobsClient) exportCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, jobQueryParameter JobQueryParameter, options *ReplicationJobsClientBeginExportOptions) (*policy.Request, error) { +func (client *ReplicationJobsClient) exportCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, jobQueryParameter JobQueryParameter, options *ReplicationJobsClientBeginExportOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/export" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -195,7 +195,7 @@ func (client *ReplicationJobsClient) exportCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, jobQueryParameter); err != nil { @@ -207,18 +207,18 @@ func (client *ReplicationJobsClient) exportCreateRequest(ctx context.Context, re // Get - Get the details of an Azure Site Recovery job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - 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) { +func (client *ReplicationJobsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, jobName string, options *ReplicationJobsClientGetOptions) (ReplicationJobsClientGetResponse, error) { var err error const operationName = "ReplicationJobsClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, jobName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, jobName, options) if err != nil { return ReplicationJobsClientGetResponse{}, err } @@ -235,16 +235,16 @@ func (client *ReplicationJobsClient) Get(ctx context.Context, resourceName strin } // getCreateRequest creates the Get request. -func (client *ReplicationJobsClient) getCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, jobName string, options *ReplicationJobsClientGetOptions) (*policy.Request, error) { +func (client *ReplicationJobsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, jobName string, options *ReplicationJobsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -258,7 +258,7 @@ func (client *ReplicationJobsClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -275,12 +275,12 @@ func (client *ReplicationJobsClient) getHandleResponse(resp *http.Response) (Rep // NewListPager - Gets the list of Azure Site Recovery Jobs for the vault. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - options - ReplicationJobsClientListOptions contains the optional parameters for the ReplicationJobsClient.NewListPager // method. -func (client *ReplicationJobsClient) NewListPager(resourceName string, resourceGroupName string, options *ReplicationJobsClientListOptions) *runtime.Pager[ReplicationJobsClientListResponse] { +func (client *ReplicationJobsClient) NewListPager(resourceGroupName string, resourceName string, options *ReplicationJobsClientListOptions) *runtime.Pager[ReplicationJobsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationJobsClientListResponse]{ More: func(page ReplicationJobsClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -292,7 +292,7 @@ func (client *ReplicationJobsClient) NewListPager(resourceName string, resourceG nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceName, resourceGroupName, options) + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) }, nil) if err != nil { return ReplicationJobsClientListResponse{}, err @@ -304,16 +304,16 @@ func (client *ReplicationJobsClient) NewListPager(resourceName string, resourceG } // listCreateRequest creates the List request. -func (client *ReplicationJobsClient) listCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, options *ReplicationJobsClientListOptions) (*policy.Request, error) { +func (client *ReplicationJobsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicationJobsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -326,7 +326,7 @@ func (client *ReplicationJobsClient) listCreateRequest(ctx context.Context, reso if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -344,15 +344,15 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - jobName - Job identifier. // - options - ReplicationJobsClientBeginRestartOptions contains the optional parameters for the ReplicationJobsClient.BeginRestart // method. -func (client *ReplicationJobsClient) BeginRestart(ctx context.Context, resourceName string, resourceGroupName string, jobName string, options *ReplicationJobsClientBeginRestartOptions) (*runtime.Poller[ReplicationJobsClientRestartResponse], error) { +func (client *ReplicationJobsClient) BeginRestart(ctx context.Context, resourceGroupName string, resourceName string, jobName string, options *ReplicationJobsClientBeginRestartOptions) (*runtime.Poller[ReplicationJobsClientRestartResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.restart(ctx, resourceName, resourceGroupName, jobName, options) + resp, err := client.restart(ctx, resourceGroupName, resourceName, jobName, options) if err != nil { return nil, err } @@ -370,14 +370,14 @@ 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 2023-08-01 -func (client *ReplicationJobsClient) restart(ctx context.Context, resourceName string, resourceGroupName string, jobName string, options *ReplicationJobsClientBeginRestartOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationJobsClient) restart(ctx context.Context, resourceGroupName string, resourceName string, jobName string, options *ReplicationJobsClientBeginRestartOptions) (*http.Response, error) { var err error const operationName = "ReplicationJobsClient.BeginRestart" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.restartCreateRequest(ctx, resourceName, resourceGroupName, jobName, options) + req, err := client.restartCreateRequest(ctx, resourceGroupName, resourceName, jobName, options) if err != nil { return nil, err } @@ -393,16 +393,16 @@ func (client *ReplicationJobsClient) restart(ctx context.Context, resourceName s } // restartCreateRequest creates the Restart request. -func (client *ReplicationJobsClient) restartCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, jobName string, options *ReplicationJobsClientBeginRestartOptions) (*policy.Request, error) { +func (client *ReplicationJobsClient) restartCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, jobName string, options *ReplicationJobsClientBeginRestartOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/restart" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -416,7 +416,7 @@ func (client *ReplicationJobsClient) restartCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -425,16 +425,16 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - jobName - Job identifier. // - resumeJobParams - Resume rob comments. // - options - ReplicationJobsClientBeginResumeOptions contains the optional parameters for the ReplicationJobsClient.BeginResume // method. -func (client *ReplicationJobsClient) BeginResume(ctx context.Context, resourceName string, resourceGroupName string, jobName string, resumeJobParams ResumeJobParams, options *ReplicationJobsClientBeginResumeOptions) (*runtime.Poller[ReplicationJobsClientResumeResponse], error) { +func (client *ReplicationJobsClient) BeginResume(ctx context.Context, resourceGroupName string, resourceName string, jobName string, resumeJobParams ResumeJobParams, options *ReplicationJobsClientBeginResumeOptions) (*runtime.Poller[ReplicationJobsClientResumeResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.resume(ctx, resourceName, resourceGroupName, jobName, resumeJobParams, options) + resp, err := client.resume(ctx, resourceGroupName, resourceName, jobName, resumeJobParams, options) if err != nil { return nil, err } @@ -452,14 +452,14 @@ 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 2023-08-01 -func (client *ReplicationJobsClient) resume(ctx context.Context, resourceName string, resourceGroupName string, jobName string, resumeJobParams ResumeJobParams, options *ReplicationJobsClientBeginResumeOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationJobsClient) resume(ctx context.Context, resourceGroupName string, resourceName string, jobName string, resumeJobParams ResumeJobParams, options *ReplicationJobsClientBeginResumeOptions) (*http.Response, error) { var err error const operationName = "ReplicationJobsClient.BeginResume" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.resumeCreateRequest(ctx, resourceName, resourceGroupName, jobName, resumeJobParams, options) + req, err := client.resumeCreateRequest(ctx, resourceGroupName, resourceName, jobName, resumeJobParams, options) if err != nil { return nil, err } @@ -475,16 +475,16 @@ func (client *ReplicationJobsClient) resume(ctx context.Context, resourceName st } // resumeCreateRequest creates the Resume request. -func (client *ReplicationJobsClient) resumeCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, jobName string, resumeJobParams ResumeJobParams, options *ReplicationJobsClientBeginResumeOptions) (*policy.Request, error) { +func (client *ReplicationJobsClient) resumeCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, jobName string, resumeJobParams ResumeJobParams, options *ReplicationJobsClientBeginResumeOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/resume" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -498,7 +498,7 @@ func (client *ReplicationJobsClient) resumeCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resumeJobParams); err != 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 cdd8ef4a8e76..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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:11.000Z"); 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.641Z"); 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:21.000Z"); 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.278Z"); 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:16.000Z"); 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.569Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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:57.000Z"); 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.800Z"); 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.318Z"); 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.302Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.323Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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:14.000Z"); 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.132Z"); 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.645Z"); 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.567Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.035Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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:43.000Z"); 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.276Z"); 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 9e467514179d..eae15660e8d9 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationlogicalnetworks_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationlogicalnetworks_client.go @@ -46,20 +46,20 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Server Id. // - logicalNetworkName - Logical network name. // - 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) { +func (client *ReplicationLogicalNetworksClient) Get(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, logicalNetworkName string, options *ReplicationLogicalNetworksClientGetOptions) (ReplicationLogicalNetworksClientGetResponse, error) { var err error const operationName = "ReplicationLogicalNetworksClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, logicalNetworkName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, fabricName, logicalNetworkName, options) if err != nil { return ReplicationLogicalNetworksClientGetResponse{}, err } @@ -76,16 +76,16 @@ func (client *ReplicationLogicalNetworksClient) Get(ctx context.Context, resourc } // getCreateRequest creates the Get request. -func (client *ReplicationLogicalNetworksClient) getCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, logicalNetworkName string, options *ReplicationLogicalNetworksClientGetOptions) (*policy.Request, error) { +func (client *ReplicationLogicalNetworksClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, logicalNetworkName string, options *ReplicationLogicalNetworksClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks/{logicalNetworkName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -103,7 +103,7 @@ func (client *ReplicationLogicalNetworksClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -120,13 +120,13 @@ func (client *ReplicationLogicalNetworksClient) getHandleResponse(resp *http.Res // NewListByReplicationFabricsPager - Lists all the logical networks of the Azure Site Recovery fabric. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Server Id. // - options - ReplicationLogicalNetworksClientListByReplicationFabricsOptions contains the optional parameters for the ReplicationLogicalNetworksClient.NewListByReplicationFabricsPager // method. -func (client *ReplicationLogicalNetworksClient) NewListByReplicationFabricsPager(resourceName string, resourceGroupName string, fabricName string, options *ReplicationLogicalNetworksClientListByReplicationFabricsOptions) *runtime.Pager[ReplicationLogicalNetworksClientListByReplicationFabricsResponse] { +func (client *ReplicationLogicalNetworksClient) NewListByReplicationFabricsPager(resourceGroupName string, resourceName string, fabricName string, options *ReplicationLogicalNetworksClientListByReplicationFabricsOptions) *runtime.Pager[ReplicationLogicalNetworksClientListByReplicationFabricsResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationLogicalNetworksClientListByReplicationFabricsResponse]{ More: func(page ReplicationLogicalNetworksClientListByReplicationFabricsResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -138,7 +138,7 @@ func (client *ReplicationLogicalNetworksClient) NewListByReplicationFabricsPager nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByReplicationFabricsCreateRequest(ctx, resourceName, resourceGroupName, fabricName, options) + return client.listByReplicationFabricsCreateRequest(ctx, resourceGroupName, resourceName, fabricName, options) }, nil) if err != nil { return ReplicationLogicalNetworksClientListByReplicationFabricsResponse{}, err @@ -150,16 +150,16 @@ func (client *ReplicationLogicalNetworksClient) NewListByReplicationFabricsPager } // listByReplicationFabricsCreateRequest creates the ListByReplicationFabrics request. -func (client *ReplicationLogicalNetworksClient) listByReplicationFabricsCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *ReplicationLogicalNetworksClientListByReplicationFabricsOptions) (*policy.Request, error) { +func (client *ReplicationLogicalNetworksClient) listByReplicationFabricsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *ReplicationLogicalNetworksClientListByReplicationFabricsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -173,7 +173,7 @@ func (client *ReplicationLogicalNetworksClient) listByReplicationFabricsCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-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 6857a11ccbff..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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 781537899f80..b0c1c5b91454 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationmigrationitems_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationmigrationitems_client.go @@ -46,18 +46,18 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - protectionContainerName - Protection container name. // - migrationItemName - Migration item name. // - input - Enable migration input. // - options - ReplicationMigrationItemsClientBeginCreateOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginCreate // method. -func (client *ReplicationMigrationItemsClient) BeginCreate(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, input EnableMigrationInput, options *ReplicationMigrationItemsClientBeginCreateOptions) (*runtime.Poller[ReplicationMigrationItemsClientCreateResponse], error) { +func (client *ReplicationMigrationItemsClient) BeginCreate(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, input EnableMigrationInput, options *ReplicationMigrationItemsClientBeginCreateOptions) (*runtime.Poller[ReplicationMigrationItemsClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input, options) + resp, err := client.create(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, migrationItemName, input, options) if err != nil { return nil, err } @@ -75,14 +75,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationMigrationItemsClient) create(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, input EnableMigrationInput, options *ReplicationMigrationItemsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "ReplicationMigrationItemsClient.BeginCreate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input, options) + req, err := client.createCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, migrationItemName, input, options) if err != nil { return nil, err } @@ -98,16 +98,16 @@ func (client *ReplicationMigrationItemsClient) create(ctx context.Context, resou } // createCreateRequest creates the Create request. -func (client *ReplicationMigrationItemsClient) createCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, input EnableMigrationInput, options *ReplicationMigrationItemsClientBeginCreateOptions) (*policy.Request, error) { +func (client *ReplicationMigrationItemsClient) createCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, input EnableMigrationInput, options *ReplicationMigrationItemsClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -129,7 +129,7 @@ func (client *ReplicationMigrationItemsClient) createCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, input); err != nil { @@ -141,17 +141,17 @@ func (client *ReplicationMigrationItemsClient) createCreateRequest(ctx context.C // BeginDelete - The operation to delete an ASR migration item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - protectionContainerName - Protection container name. // - migrationItemName - Migration item name. // - options - ReplicationMigrationItemsClientBeginDeleteOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginDelete // method. -func (client *ReplicationMigrationItemsClient) BeginDelete(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, options *ReplicationMigrationItemsClientBeginDeleteOptions) (*runtime.Poller[ReplicationMigrationItemsClientDeleteResponse], error) { +func (client *ReplicationMigrationItemsClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, options *ReplicationMigrationItemsClientBeginDeleteOptions) (*runtime.Poller[ReplicationMigrationItemsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, options) + resp, err := client.deleteOperation(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, migrationItemName, options) if err != nil { return nil, err } @@ -169,14 +169,14 @@ 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 2023-08-01 -func (client *ReplicationMigrationItemsClient) deleteOperation(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, options *ReplicationMigrationItemsClientBeginDeleteOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationMigrationItemsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, options *ReplicationMigrationItemsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ReplicationMigrationItemsClient.BeginDelete" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, options) + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, migrationItemName, options) if err != nil { return nil, err } @@ -192,16 +192,16 @@ func (client *ReplicationMigrationItemsClient) deleteOperation(ctx context.Conte } // deleteCreateRequest creates the Delete request. -func (client *ReplicationMigrationItemsClient) deleteCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, options *ReplicationMigrationItemsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ReplicationMigrationItemsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, options *ReplicationMigrationItemsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -223,7 +223,7 @@ func (client *ReplicationMigrationItemsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") if options != nil && options.DeleteOption != nil { reqQP.Set("deleteOption", *options.DeleteOption) } @@ -234,21 +234,21 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric unique name. // - protectionContainerName - Protection container name. // - migrationItemName - Migration item name. // - 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) { +func (client *ReplicationMigrationItemsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, options *ReplicationMigrationItemsClientGetOptions) (ReplicationMigrationItemsClientGetResponse, error) { var err error const operationName = "ReplicationMigrationItemsClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, migrationItemName, options) if err != nil { return ReplicationMigrationItemsClientGetResponse{}, err } @@ -265,16 +265,16 @@ func (client *ReplicationMigrationItemsClient) Get(ctx context.Context, resource } // getCreateRequest creates the Get request. -func (client *ReplicationMigrationItemsClient) getCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, options *ReplicationMigrationItemsClientGetOptions) (*policy.Request, error) { +func (client *ReplicationMigrationItemsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, options *ReplicationMigrationItemsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -296,7 +296,7 @@ func (client *ReplicationMigrationItemsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -313,12 +313,12 @@ func (client *ReplicationMigrationItemsClient) getHandleResponse(resp *http.Resp // NewListPager - Gets the list of migration items in the vault. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - options - ReplicationMigrationItemsClientListOptions contains the optional parameters for the ReplicationMigrationItemsClient.NewListPager // method. -func (client *ReplicationMigrationItemsClient) NewListPager(resourceName string, resourceGroupName string, options *ReplicationMigrationItemsClientListOptions) *runtime.Pager[ReplicationMigrationItemsClientListResponse] { +func (client *ReplicationMigrationItemsClient) NewListPager(resourceGroupName string, resourceName string, options *ReplicationMigrationItemsClientListOptions) *runtime.Pager[ReplicationMigrationItemsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationMigrationItemsClientListResponse]{ More: func(page ReplicationMigrationItemsClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -330,7 +330,7 @@ func (client *ReplicationMigrationItemsClient) NewListPager(resourceName string, nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceName, resourceGroupName, options) + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) }, nil) if err != nil { return ReplicationMigrationItemsClientListResponse{}, err @@ -342,16 +342,16 @@ func (client *ReplicationMigrationItemsClient) NewListPager(resourceName string, } // listCreateRequest creates the List request. -func (client *ReplicationMigrationItemsClient) listCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, options *ReplicationMigrationItemsClientListOptions) (*policy.Request, error) { +func (client *ReplicationMigrationItemsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicationMigrationItemsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationMigrationItems" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -364,7 +364,7 @@ func (client *ReplicationMigrationItemsClient) listCreateRequest(ctx context.Con if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") if options != nil && options.SkipToken != nil { reqQP.Set("skipToken", *options.SkipToken) } @@ -387,14 +387,14 @@ func (client *ReplicationMigrationItemsClient) listHandleResponse(resp *http.Res // NewListByReplicationProtectionContainersPager - Gets the list of ASR migration items in the protection container. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - protectionContainerName - Protection container name. // - options - ReplicationMigrationItemsClientListByReplicationProtectionContainersOptions contains the optional parameters // for the ReplicationMigrationItemsClient.NewListByReplicationProtectionContainersPager method. -func (client *ReplicationMigrationItemsClient) NewListByReplicationProtectionContainersPager(resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, options *ReplicationMigrationItemsClientListByReplicationProtectionContainersOptions) *runtime.Pager[ReplicationMigrationItemsClientListByReplicationProtectionContainersResponse] { +func (client *ReplicationMigrationItemsClient) NewListByReplicationProtectionContainersPager(resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, options *ReplicationMigrationItemsClientListByReplicationProtectionContainersOptions) *runtime.Pager[ReplicationMigrationItemsClientListByReplicationProtectionContainersResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationMigrationItemsClientListByReplicationProtectionContainersResponse]{ More: func(page ReplicationMigrationItemsClientListByReplicationProtectionContainersResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -406,7 +406,7 @@ func (client *ReplicationMigrationItemsClient) NewListByReplicationProtectionCon nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByReplicationProtectionContainersCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, options) + return client.listByReplicationProtectionContainersCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, options) }, nil) if err != nil { return ReplicationMigrationItemsClientListByReplicationProtectionContainersResponse{}, err @@ -418,16 +418,16 @@ func (client *ReplicationMigrationItemsClient) NewListByReplicationProtectionCon } // listByReplicationProtectionContainersCreateRequest creates the ListByReplicationProtectionContainers request. -func (client *ReplicationMigrationItemsClient) listByReplicationProtectionContainersCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, options *ReplicationMigrationItemsClientListByReplicationProtectionContainersOptions) (*policy.Request, error) { +func (client *ReplicationMigrationItemsClient) listByReplicationProtectionContainersCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, options *ReplicationMigrationItemsClientListByReplicationProtectionContainersOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -448,7 +448,7 @@ func (client *ReplicationMigrationItemsClient) listByReplicationProtectionContai if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") if options != nil && options.SkipToken != nil { reqQP.Set("skipToken", *options.SkipToken) } @@ -472,18 +472,18 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - protectionContainerName - Protection container name. // - migrationItemName - Migration item name. // - migrateInput - Migrate input. // - options - ReplicationMigrationItemsClientBeginMigrateOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginMigrate // method. -func (client *ReplicationMigrationItemsClient) BeginMigrate(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, migrateInput MigrateInput, options *ReplicationMigrationItemsClientBeginMigrateOptions) (*runtime.Poller[ReplicationMigrationItemsClientMigrateResponse], error) { +func (client *ReplicationMigrationItemsClient) BeginMigrate(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, migrateInput MigrateInput, options *ReplicationMigrationItemsClientBeginMigrateOptions) (*runtime.Poller[ReplicationMigrationItemsClientMigrateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.migrate(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, migrateInput, options) + resp, err := client.migrate(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, migrationItemName, migrateInput, options) if err != nil { return nil, err } @@ -501,14 +501,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationMigrationItemsClient) migrate(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, migrateInput MigrateInput, options *ReplicationMigrationItemsClientBeginMigrateOptions) (*http.Response, error) { var err error const operationName = "ReplicationMigrationItemsClient.BeginMigrate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.migrateCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, migrateInput, options) + req, err := client.migrateCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, migrationItemName, migrateInput, options) if err != nil { return nil, err } @@ -524,16 +524,16 @@ func (client *ReplicationMigrationItemsClient) migrate(ctx context.Context, reso } // migrateCreateRequest creates the Migrate request. -func (client *ReplicationMigrationItemsClient) migrateCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, migrateInput MigrateInput, options *ReplicationMigrationItemsClientBeginMigrateOptions) (*policy.Request, error) { +func (client *ReplicationMigrationItemsClient) migrateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, migrateInput MigrateInput, options *ReplicationMigrationItemsClientBeginMigrateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrate" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -555,7 +555,7 @@ func (client *ReplicationMigrationItemsClient) migrateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, migrateInput); err != nil { @@ -567,18 +567,18 @@ func (client *ReplicationMigrationItemsClient) migrateCreateRequest(ctx context. // BeginPauseReplication - The operation to initiate pause replication of the item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - protectionContainerName - Protection container name. // - migrationItemName - Migration item name. // - pauseReplicationInput - Pause replication input. // - options - ReplicationMigrationItemsClientBeginPauseReplicationOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginPauseReplication // method. -func (client *ReplicationMigrationItemsClient) BeginPauseReplication(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, pauseReplicationInput PauseReplicationInput, options *ReplicationMigrationItemsClientBeginPauseReplicationOptions) (*runtime.Poller[ReplicationMigrationItemsClientPauseReplicationResponse], error) { +func (client *ReplicationMigrationItemsClient) BeginPauseReplication(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, pauseReplicationInput PauseReplicationInput, options *ReplicationMigrationItemsClientBeginPauseReplicationOptions) (*runtime.Poller[ReplicationMigrationItemsClientPauseReplicationResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.pauseReplication(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, pauseReplicationInput, options) + resp, err := client.pauseReplication(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, migrationItemName, pauseReplicationInput, options) if err != nil { return nil, err } @@ -596,14 +596,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationMigrationItemsClient) pauseReplication(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, pauseReplicationInput PauseReplicationInput, options *ReplicationMigrationItemsClientBeginPauseReplicationOptions) (*http.Response, error) { var err error const operationName = "ReplicationMigrationItemsClient.BeginPauseReplication" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.pauseReplicationCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, pauseReplicationInput, options) + req, err := client.pauseReplicationCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, migrationItemName, pauseReplicationInput, options) if err != nil { return nil, err } @@ -619,16 +619,16 @@ func (client *ReplicationMigrationItemsClient) pauseReplication(ctx context.Cont } // pauseReplicationCreateRequest creates the PauseReplication request. -func (client *ReplicationMigrationItemsClient) pauseReplicationCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, pauseReplicationInput PauseReplicationInput, options *ReplicationMigrationItemsClientBeginPauseReplicationOptions) (*policy.Request, error) { +func (client *ReplicationMigrationItemsClient) pauseReplicationCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, pauseReplicationInput PauseReplicationInput, options *ReplicationMigrationItemsClientBeginPauseReplicationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/pauseReplication" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -650,7 +650,7 @@ func (client *ReplicationMigrationItemsClient) pauseReplicationCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, pauseReplicationInput); err != nil { @@ -662,18 +662,18 @@ func (client *ReplicationMigrationItemsClient) pauseReplicationCreateRequest(ctx // BeginResumeReplication - The operation to initiate resume replication of the item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - protectionContainerName - Protection container name. // - migrationItemName - Migration item name. // - resumeReplicationInput - Resume replication input. // - options - ReplicationMigrationItemsClientBeginResumeReplicationOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginResumeReplication // method. -func (client *ReplicationMigrationItemsClient) BeginResumeReplication(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, resumeReplicationInput ResumeReplicationInput, options *ReplicationMigrationItemsClientBeginResumeReplicationOptions) (*runtime.Poller[ReplicationMigrationItemsClientResumeReplicationResponse], error) { +func (client *ReplicationMigrationItemsClient) BeginResumeReplication(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, resumeReplicationInput ResumeReplicationInput, options *ReplicationMigrationItemsClientBeginResumeReplicationOptions) (*runtime.Poller[ReplicationMigrationItemsClientResumeReplicationResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.resumeReplication(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, resumeReplicationInput, options) + resp, err := client.resumeReplication(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, migrationItemName, resumeReplicationInput, options) if err != nil { return nil, err } @@ -691,14 +691,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationMigrationItemsClient) resumeReplication(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, resumeReplicationInput ResumeReplicationInput, options *ReplicationMigrationItemsClientBeginResumeReplicationOptions) (*http.Response, error) { var err error const operationName = "ReplicationMigrationItemsClient.BeginResumeReplication" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.resumeReplicationCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, resumeReplicationInput, options) + req, err := client.resumeReplicationCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, migrationItemName, resumeReplicationInput, options) if err != nil { return nil, err } @@ -714,16 +714,16 @@ func (client *ReplicationMigrationItemsClient) resumeReplication(ctx context.Con } // resumeReplicationCreateRequest creates the ResumeReplication request. -func (client *ReplicationMigrationItemsClient) resumeReplicationCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, resumeReplicationInput ResumeReplicationInput, options *ReplicationMigrationItemsClientBeginResumeReplicationOptions) (*policy.Request, error) { +func (client *ReplicationMigrationItemsClient) resumeReplicationCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, resumeReplicationInput ResumeReplicationInput, options *ReplicationMigrationItemsClientBeginResumeReplicationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/resumeReplication" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -745,7 +745,7 @@ func (client *ReplicationMigrationItemsClient) resumeReplicationCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resumeReplicationInput); err != nil { @@ -757,18 +757,18 @@ func (client *ReplicationMigrationItemsClient) resumeReplicationCreateRequest(ct // 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - protectionContainerName - Protection container name. // - migrationItemName - Migration item name. // - input - Resync input. // - options - ReplicationMigrationItemsClientBeginResyncOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginResync // method. -func (client *ReplicationMigrationItemsClient) BeginResync(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, input ResyncInput, options *ReplicationMigrationItemsClientBeginResyncOptions) (*runtime.Poller[ReplicationMigrationItemsClientResyncResponse], error) { +func (client *ReplicationMigrationItemsClient) BeginResync(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, input ResyncInput, options *ReplicationMigrationItemsClientBeginResyncOptions) (*runtime.Poller[ReplicationMigrationItemsClientResyncResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.resync(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input, options) + resp, err := client.resync(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, migrationItemName, input, options) if err != nil { return nil, err } @@ -786,14 +786,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationMigrationItemsClient) resync(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, input ResyncInput, options *ReplicationMigrationItemsClientBeginResyncOptions) (*http.Response, error) { var err error const operationName = "ReplicationMigrationItemsClient.BeginResync" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.resyncCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input, options) + req, err := client.resyncCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, migrationItemName, input, options) if err != nil { return nil, err } @@ -809,16 +809,16 @@ func (client *ReplicationMigrationItemsClient) resync(ctx context.Context, resou } // resyncCreateRequest creates the Resync request. -func (client *ReplicationMigrationItemsClient) resyncCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, input ResyncInput, options *ReplicationMigrationItemsClientBeginResyncOptions) (*policy.Request, error) { +func (client *ReplicationMigrationItemsClient) resyncCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, input ResyncInput, options *ReplicationMigrationItemsClientBeginResyncOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/resync" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -840,7 +840,7 @@ func (client *ReplicationMigrationItemsClient) resyncCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, input); err != nil { @@ -852,18 +852,18 @@ func (client *ReplicationMigrationItemsClient) resyncCreateRequest(ctx context.C // BeginTestMigrate - The operation to initiate test migration of the item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - protectionContainerName - Protection container name. // - migrationItemName - Migration item name. // - testMigrateInput - Test migrate input. // - options - ReplicationMigrationItemsClientBeginTestMigrateOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginTestMigrate // method. -func (client *ReplicationMigrationItemsClient) BeginTestMigrate(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput TestMigrateInput, options *ReplicationMigrationItemsClientBeginTestMigrateOptions) (*runtime.Poller[ReplicationMigrationItemsClientTestMigrateResponse], error) { +func (client *ReplicationMigrationItemsClient) BeginTestMigrate(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput TestMigrateInput, options *ReplicationMigrationItemsClientBeginTestMigrateOptions) (*runtime.Poller[ReplicationMigrationItemsClientTestMigrateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.testMigrate(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, testMigrateInput, options) + resp, err := client.testMigrate(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, migrationItemName, testMigrateInput, options) if err != nil { return nil, err } @@ -881,14 +881,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationMigrationItemsClient) testMigrate(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput TestMigrateInput, options *ReplicationMigrationItemsClientBeginTestMigrateOptions) (*http.Response, error) { var err error const operationName = "ReplicationMigrationItemsClient.BeginTestMigrate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.testMigrateCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, testMigrateInput, options) + req, err := client.testMigrateCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, migrationItemName, testMigrateInput, options) if err != nil { return nil, err } @@ -904,16 +904,16 @@ func (client *ReplicationMigrationItemsClient) testMigrate(ctx context.Context, } // testMigrateCreateRequest creates the TestMigrate request. -func (client *ReplicationMigrationItemsClient) testMigrateCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput TestMigrateInput, options *ReplicationMigrationItemsClientBeginTestMigrateOptions) (*policy.Request, error) { +func (client *ReplicationMigrationItemsClient) testMigrateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, testMigrateInput TestMigrateInput, options *ReplicationMigrationItemsClientBeginTestMigrateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrate" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -935,7 +935,7 @@ func (client *ReplicationMigrationItemsClient) testMigrateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, testMigrateInput); err != nil { @@ -947,18 +947,18 @@ func (client *ReplicationMigrationItemsClient) testMigrateCreateRequest(ctx cont // BeginTestMigrateCleanup - The operation to initiate test migrate cleanup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - protectionContainerName - Protection container name. // - migrationItemName - Migration item name. // - testMigrateCleanupInput - Test migrate cleanup input. // - options - ReplicationMigrationItemsClientBeginTestMigrateCleanupOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginTestMigrateCleanup // method. -func (client *ReplicationMigrationItemsClient) BeginTestMigrateCleanup(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput TestMigrateCleanupInput, options *ReplicationMigrationItemsClientBeginTestMigrateCleanupOptions) (*runtime.Poller[ReplicationMigrationItemsClientTestMigrateCleanupResponse], error) { +func (client *ReplicationMigrationItemsClient) BeginTestMigrateCleanup(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput TestMigrateCleanupInput, options *ReplicationMigrationItemsClientBeginTestMigrateCleanupOptions) (*runtime.Poller[ReplicationMigrationItemsClientTestMigrateCleanupResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.testMigrateCleanup(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput, options) + resp, err := client.testMigrateCleanup(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput, options) if err != nil { return nil, err } @@ -976,14 +976,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationMigrationItemsClient) testMigrateCleanup(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput TestMigrateCleanupInput, options *ReplicationMigrationItemsClientBeginTestMigrateCleanupOptions) (*http.Response, error) { var err error const operationName = "ReplicationMigrationItemsClient.BeginTestMigrateCleanup" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.testMigrateCleanupCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput, options) + req, err := client.testMigrateCleanupCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput, options) if err != nil { return nil, err } @@ -999,16 +999,16 @@ func (client *ReplicationMigrationItemsClient) testMigrateCleanup(ctx context.Co } // testMigrateCleanupCreateRequest creates the TestMigrateCleanup request. -func (client *ReplicationMigrationItemsClient) testMigrateCleanupCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput TestMigrateCleanupInput, options *ReplicationMigrationItemsClientBeginTestMigrateCleanupOptions) (*policy.Request, error) { +func (client *ReplicationMigrationItemsClient) testMigrateCleanupCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, testMigrateCleanupInput TestMigrateCleanupInput, options *ReplicationMigrationItemsClientBeginTestMigrateCleanupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrateCleanup" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -1030,7 +1030,7 @@ func (client *ReplicationMigrationItemsClient) testMigrateCleanupCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, testMigrateCleanupInput); err != nil { @@ -1042,18 +1042,18 @@ func (client *ReplicationMigrationItemsClient) testMigrateCleanupCreateRequest(c // 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - protectionContainerName - Protection container name. // - migrationItemName - Migration item name. // - input - Update migration item input. // - options - ReplicationMigrationItemsClientBeginUpdateOptions contains the optional parameters for the ReplicationMigrationItemsClient.BeginUpdate // method. -func (client *ReplicationMigrationItemsClient) BeginUpdate(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, input UpdateMigrationItemInput, options *ReplicationMigrationItemsClientBeginUpdateOptions) (*runtime.Poller[ReplicationMigrationItemsClientUpdateResponse], error) { +func (client *ReplicationMigrationItemsClient) BeginUpdate(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, input UpdateMigrationItemInput, options *ReplicationMigrationItemsClientBeginUpdateOptions) (*runtime.Poller[ReplicationMigrationItemsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input, options) + resp, err := client.update(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, migrationItemName, input, options) if err != nil { return nil, err } @@ -1071,14 +1071,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationMigrationItemsClient) update(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, input UpdateMigrationItemInput, options *ReplicationMigrationItemsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ReplicationMigrationItemsClient.BeginUpdate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, migrationItemName, input, options) + req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, migrationItemName, input, options) if err != nil { return nil, err } @@ -1094,16 +1094,16 @@ func (client *ReplicationMigrationItemsClient) update(ctx context.Context, resou } // updateCreateRequest creates the Update request. -func (client *ReplicationMigrationItemsClient) updateCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, migrationItemName string, input UpdateMigrationItemInput, options *ReplicationMigrationItemsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *ReplicationMigrationItemsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, migrationItemName string, input UpdateMigrationItemInput, options *ReplicationMigrationItemsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -1125,7 +1125,7 @@ func (client *ReplicationMigrationItemsClient) updateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, input); err != 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 c2f664b11528..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.808Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.808Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.808Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.808Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.808Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.808Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.808Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.808Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.808Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.808Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.808Z"); 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 4653e2956c6a..13ccf9fcd9c2 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationnetworkmappings_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationnetworkmappings_client.go @@ -46,18 +46,18 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Primary fabric name. // - networkName - Primary network name. // - networkMappingName - Network mapping name. // - input - Create network mapping input. // - options - ReplicationNetworkMappingsClientBeginCreateOptions contains the optional parameters for the ReplicationNetworkMappingsClient.BeginCreate // method. -func (client *ReplicationNetworkMappingsClient) BeginCreate(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, networkName string, networkMappingName string, input CreateNetworkMappingInput, options *ReplicationNetworkMappingsClientBeginCreateOptions) (*runtime.Poller[ReplicationNetworkMappingsClientCreateResponse], error) { +func (client *ReplicationNetworkMappingsClient) BeginCreate(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, networkName string, networkMappingName string, input CreateNetworkMappingInput, options *ReplicationNetworkMappingsClientBeginCreateOptions) (*runtime.Poller[ReplicationNetworkMappingsClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceName, resourceGroupName, fabricName, networkName, networkMappingName, input, options) + resp, err := client.create(ctx, resourceGroupName, resourceName, fabricName, networkName, networkMappingName, input, options) if err != nil { return nil, err } @@ -75,14 +75,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationNetworkMappingsClient) create(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, networkName string, networkMappingName string, input CreateNetworkMappingInput, options *ReplicationNetworkMappingsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "ReplicationNetworkMappingsClient.BeginCreate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, fabricName, networkName, networkMappingName, input, options) + req, err := client.createCreateRequest(ctx, resourceGroupName, resourceName, fabricName, networkName, networkMappingName, input, options) if err != nil { return nil, err } @@ -98,16 +98,16 @@ func (client *ReplicationNetworkMappingsClient) create(ctx context.Context, reso } // createCreateRequest creates the Create request. -func (client *ReplicationNetworkMappingsClient) createCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, networkName string, networkMappingName string, input CreateNetworkMappingInput, options *ReplicationNetworkMappingsClientBeginCreateOptions) (*policy.Request, error) { +func (client *ReplicationNetworkMappingsClient) createCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, networkName string, networkMappingName string, input CreateNetworkMappingInput, options *ReplicationNetworkMappingsClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -129,7 +129,7 @@ func (client *ReplicationNetworkMappingsClient) createCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, input); err != nil { @@ -141,17 +141,17 @@ func (client *ReplicationNetworkMappingsClient) createCreateRequest(ctx context. // BeginDelete - The operation to delete a network mapping. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Primary fabric name. // - networkName - Primary network name. // - networkMappingName - ARM Resource Name for network mapping. // - options - ReplicationNetworkMappingsClientBeginDeleteOptions contains the optional parameters for the ReplicationNetworkMappingsClient.BeginDelete // method. -func (client *ReplicationNetworkMappingsClient) BeginDelete(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, networkName string, networkMappingName string, options *ReplicationNetworkMappingsClientBeginDeleteOptions) (*runtime.Poller[ReplicationNetworkMappingsClientDeleteResponse], error) { +func (client *ReplicationNetworkMappingsClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, networkName string, networkMappingName string, options *ReplicationNetworkMappingsClientBeginDeleteOptions) (*runtime.Poller[ReplicationNetworkMappingsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceName, resourceGroupName, fabricName, networkName, networkMappingName, options) + resp, err := client.deleteOperation(ctx, resourceGroupName, resourceName, fabricName, networkName, networkMappingName, options) if err != nil { return nil, err } @@ -169,14 +169,14 @@ 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 2023-08-01 -func (client *ReplicationNetworkMappingsClient) deleteOperation(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, networkName string, networkMappingName string, options *ReplicationNetworkMappingsClientBeginDeleteOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationNetworkMappingsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, networkName string, networkMappingName string, options *ReplicationNetworkMappingsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ReplicationNetworkMappingsClient.BeginDelete" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceName, resourceGroupName, fabricName, networkName, networkMappingName, options) + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, fabricName, networkName, networkMappingName, options) if err != nil { return nil, err } @@ -192,16 +192,16 @@ func (client *ReplicationNetworkMappingsClient) deleteOperation(ctx context.Cont } // deleteCreateRequest creates the Delete request. -func (client *ReplicationNetworkMappingsClient) deleteCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, networkName string, networkMappingName string, options *ReplicationNetworkMappingsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ReplicationNetworkMappingsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, networkName string, networkMappingName string, options *ReplicationNetworkMappingsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -223,7 +223,7 @@ func (client *ReplicationNetworkMappingsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -231,21 +231,21 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Primary fabric name. // - networkName - Primary network name. // - networkMappingName - Network mapping name. // - 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) { +func (client *ReplicationNetworkMappingsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, networkName string, networkMappingName string, options *ReplicationNetworkMappingsClientGetOptions) (ReplicationNetworkMappingsClientGetResponse, error) { var err error const operationName = "ReplicationNetworkMappingsClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, networkName, networkMappingName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, fabricName, networkName, networkMappingName, options) if err != nil { return ReplicationNetworkMappingsClientGetResponse{}, err } @@ -262,16 +262,16 @@ func (client *ReplicationNetworkMappingsClient) Get(ctx context.Context, resourc } // getCreateRequest creates the Get request. -func (client *ReplicationNetworkMappingsClient) getCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, networkName string, networkMappingName string, options *ReplicationNetworkMappingsClientGetOptions) (*policy.Request, error) { +func (client *ReplicationNetworkMappingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, networkName string, networkMappingName string, options *ReplicationNetworkMappingsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -293,7 +293,7 @@ func (client *ReplicationNetworkMappingsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -310,12 +310,12 @@ func (client *ReplicationNetworkMappingsClient) getHandleResponse(resp *http.Res // NewListPager - Lists all ASR network mappings in the vault. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - options - ReplicationNetworkMappingsClientListOptions contains the optional parameters for the ReplicationNetworkMappingsClient.NewListPager // method. -func (client *ReplicationNetworkMappingsClient) NewListPager(resourceName string, resourceGroupName string, options *ReplicationNetworkMappingsClientListOptions) *runtime.Pager[ReplicationNetworkMappingsClientListResponse] { +func (client *ReplicationNetworkMappingsClient) NewListPager(resourceGroupName string, resourceName string, options *ReplicationNetworkMappingsClientListOptions) *runtime.Pager[ReplicationNetworkMappingsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationNetworkMappingsClientListResponse]{ More: func(page ReplicationNetworkMappingsClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -327,7 +327,7 @@ func (client *ReplicationNetworkMappingsClient) NewListPager(resourceName string nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceName, resourceGroupName, options) + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) }, nil) if err != nil { return ReplicationNetworkMappingsClientListResponse{}, err @@ -339,16 +339,16 @@ func (client *ReplicationNetworkMappingsClient) NewListPager(resourceName string } // listCreateRequest creates the List request. -func (client *ReplicationNetworkMappingsClient) listCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, options *ReplicationNetworkMappingsClientListOptions) (*policy.Request, error) { +func (client *ReplicationNetworkMappingsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicationNetworkMappingsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationNetworkMappings" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -358,7 +358,7 @@ func (client *ReplicationNetworkMappingsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -375,14 +375,14 @@ func (client *ReplicationNetworkMappingsClient) listHandleResponse(resp *http.Re // NewListByReplicationNetworksPager - Lists all ASR network mappings for the specified network. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Primary fabric name. // - networkName - Primary network name. // - options - ReplicationNetworkMappingsClientListByReplicationNetworksOptions contains the optional parameters for the ReplicationNetworkMappingsClient.NewListByReplicationNetworksPager // method. -func (client *ReplicationNetworkMappingsClient) NewListByReplicationNetworksPager(resourceName string, resourceGroupName string, fabricName string, networkName string, options *ReplicationNetworkMappingsClientListByReplicationNetworksOptions) *runtime.Pager[ReplicationNetworkMappingsClientListByReplicationNetworksResponse] { +func (client *ReplicationNetworkMappingsClient) NewListByReplicationNetworksPager(resourceGroupName string, resourceName string, fabricName string, networkName string, options *ReplicationNetworkMappingsClientListByReplicationNetworksOptions) *runtime.Pager[ReplicationNetworkMappingsClientListByReplicationNetworksResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationNetworkMappingsClientListByReplicationNetworksResponse]{ More: func(page ReplicationNetworkMappingsClientListByReplicationNetworksResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -394,7 +394,7 @@ func (client *ReplicationNetworkMappingsClient) NewListByReplicationNetworksPage nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByReplicationNetworksCreateRequest(ctx, resourceName, resourceGroupName, fabricName, networkName, options) + return client.listByReplicationNetworksCreateRequest(ctx, resourceGroupName, resourceName, fabricName, networkName, options) }, nil) if err != nil { return ReplicationNetworkMappingsClientListByReplicationNetworksResponse{}, err @@ -406,16 +406,16 @@ func (client *ReplicationNetworkMappingsClient) NewListByReplicationNetworksPage } // listByReplicationNetworksCreateRequest creates the ListByReplicationNetworks request. -func (client *ReplicationNetworkMappingsClient) listByReplicationNetworksCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, networkName string, options *ReplicationNetworkMappingsClientListByReplicationNetworksOptions) (*policy.Request, error) { +func (client *ReplicationNetworkMappingsClient) listByReplicationNetworksCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, networkName string, options *ReplicationNetworkMappingsClientListByReplicationNetworksOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -433,7 +433,7 @@ func (client *ReplicationNetworkMappingsClient) listByReplicationNetworksCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -451,18 +451,18 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Primary fabric name. // - networkName - Primary network name. // - networkMappingName - Network mapping name. // - input - Update network mapping input. // - options - ReplicationNetworkMappingsClientBeginUpdateOptions contains the optional parameters for the ReplicationNetworkMappingsClient.BeginUpdate // method. -func (client *ReplicationNetworkMappingsClient) BeginUpdate(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, networkName string, networkMappingName string, input UpdateNetworkMappingInput, options *ReplicationNetworkMappingsClientBeginUpdateOptions) (*runtime.Poller[ReplicationNetworkMappingsClientUpdateResponse], error) { +func (client *ReplicationNetworkMappingsClient) BeginUpdate(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, networkName string, networkMappingName string, input UpdateNetworkMappingInput, options *ReplicationNetworkMappingsClientBeginUpdateOptions) (*runtime.Poller[ReplicationNetworkMappingsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceName, resourceGroupName, fabricName, networkName, networkMappingName, input, options) + resp, err := client.update(ctx, resourceGroupName, resourceName, fabricName, networkName, networkMappingName, input, options) if err != nil { return nil, err } @@ -480,14 +480,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationNetworkMappingsClient) update(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, networkName string, networkMappingName string, input UpdateNetworkMappingInput, options *ReplicationNetworkMappingsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ReplicationNetworkMappingsClient.BeginUpdate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceName, resourceGroupName, fabricName, networkName, networkMappingName, input, options) + req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, fabricName, networkName, networkMappingName, input, options) if err != nil { return nil, err } @@ -503,16 +503,16 @@ func (client *ReplicationNetworkMappingsClient) update(ctx context.Context, reso } // updateCreateRequest creates the Update request. -func (client *ReplicationNetworkMappingsClient) updateCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, networkName string, networkMappingName string, input UpdateNetworkMappingInput, options *ReplicationNetworkMappingsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *ReplicationNetworkMappingsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, networkName string, networkMappingName string, input UpdateNetworkMappingInput, options *ReplicationNetworkMappingsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -534,7 +534,7 @@ func (client *ReplicationNetworkMappingsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, input); err != 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 bca8ff4ae195..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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 f68c73d06f81..be593cd71c94 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationnetworks_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationnetworks_client.go @@ -46,19 +46,19 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - 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) { +func (client *ReplicationNetworksClient) Get(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, networkName string, options *ReplicationNetworksClientGetOptions) (ReplicationNetworksClientGetResponse, error) { var err error const operationName = "ReplicationNetworksClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, networkName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, fabricName, networkName, options) if err != nil { return ReplicationNetworksClientGetResponse{}, err } @@ -75,16 +75,16 @@ func (client *ReplicationNetworksClient) Get(ctx context.Context, resourceName s } // getCreateRequest creates the Get request. -func (client *ReplicationNetworksClient) getCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, networkName string, options *ReplicationNetworksClientGetOptions) (*policy.Request, error) { +func (client *ReplicationNetworksClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, networkName string, options *ReplicationNetworksClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -102,7 +102,7 @@ func (client *ReplicationNetworksClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -119,12 +119,12 @@ func (client *ReplicationNetworksClient) getHandleResponse(resp *http.Response) // NewListPager - Lists the networks available in a vault. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - options - ReplicationNetworksClientListOptions contains the optional parameters for the ReplicationNetworksClient.NewListPager // method. -func (client *ReplicationNetworksClient) NewListPager(resourceName string, resourceGroupName string, options *ReplicationNetworksClientListOptions) *runtime.Pager[ReplicationNetworksClientListResponse] { +func (client *ReplicationNetworksClient) NewListPager(resourceGroupName string, resourceName string, options *ReplicationNetworksClientListOptions) *runtime.Pager[ReplicationNetworksClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationNetworksClientListResponse]{ More: func(page ReplicationNetworksClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -136,7 +136,7 @@ func (client *ReplicationNetworksClient) NewListPager(resourceName string, resou nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceName, resourceGroupName, options) + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) }, nil) if err != nil { return ReplicationNetworksClientListResponse{}, err @@ -148,16 +148,16 @@ func (client *ReplicationNetworksClient) NewListPager(resourceName string, resou } // listCreateRequest creates the List request. -func (client *ReplicationNetworksClient) listCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, options *ReplicationNetworksClientListOptions) (*policy.Request, error) { +func (client *ReplicationNetworksClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicationNetworksClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationNetworks" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -167,7 +167,7 @@ func (client *ReplicationNetworksClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -184,13 +184,13 @@ func (client *ReplicationNetworksClient) listHandleResponse(resp *http.Response) // NewListByReplicationFabricsPager - Lists the networks available for a fabric. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - options - ReplicationNetworksClientListByReplicationFabricsOptions contains the optional parameters for the ReplicationNetworksClient.NewListByReplicationFabricsPager // method. -func (client *ReplicationNetworksClient) NewListByReplicationFabricsPager(resourceName string, resourceGroupName string, fabricName string, options *ReplicationNetworksClientListByReplicationFabricsOptions) *runtime.Pager[ReplicationNetworksClientListByReplicationFabricsResponse] { +func (client *ReplicationNetworksClient) NewListByReplicationFabricsPager(resourceGroupName string, resourceName string, fabricName string, options *ReplicationNetworksClientListByReplicationFabricsOptions) *runtime.Pager[ReplicationNetworksClientListByReplicationFabricsResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationNetworksClientListByReplicationFabricsResponse]{ More: func(page ReplicationNetworksClientListByReplicationFabricsResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -202,7 +202,7 @@ func (client *ReplicationNetworksClient) NewListByReplicationFabricsPager(resour nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByReplicationFabricsCreateRequest(ctx, resourceName, resourceGroupName, fabricName, options) + return client.listByReplicationFabricsCreateRequest(ctx, resourceGroupName, resourceName, fabricName, options) }, nil) if err != nil { return ReplicationNetworksClientListByReplicationFabricsResponse{}, err @@ -214,16 +214,16 @@ func (client *ReplicationNetworksClient) NewListByReplicationFabricsPager(resour } // listByReplicationFabricsCreateRequest creates the ListByReplicationFabrics request. -func (client *ReplicationNetworksClient) listByReplicationFabricsCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *ReplicationNetworksClientListByReplicationFabricsOptions) (*policy.Request, error) { +func (client *ReplicationNetworksClient) listByReplicationFabricsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *ReplicationNetworksClientListByReplicationFabricsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -237,7 +237,7 @@ func (client *ReplicationNetworksClient) listByReplicationFabricsCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-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 b3dac1f244f5..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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 72bd97500008..dd0b632be076 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationpolicies_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationpolicies_client.go @@ -46,16 +46,16 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - policyName - Replication policy name. // - input - Create policy input. // - options - ReplicationPoliciesClientBeginCreateOptions contains the optional parameters for the ReplicationPoliciesClient.BeginCreate // method. -func (client *ReplicationPoliciesClient) BeginCreate(ctx context.Context, resourceName string, resourceGroupName string, policyName string, input CreatePolicyInput, options *ReplicationPoliciesClientBeginCreateOptions) (*runtime.Poller[ReplicationPoliciesClientCreateResponse], error) { +func (client *ReplicationPoliciesClient) BeginCreate(ctx context.Context, resourceGroupName string, resourceName string, policyName string, input CreatePolicyInput, options *ReplicationPoliciesClientBeginCreateOptions) (*runtime.Poller[ReplicationPoliciesClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceName, resourceGroupName, policyName, input, options) + resp, err := client.create(ctx, resourceGroupName, resourceName, policyName, input, options) if err != nil { return nil, err } @@ -73,14 +73,14 @@ 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 2023-08-01 -func (client *ReplicationPoliciesClient) create(ctx context.Context, resourceName string, resourceGroupName string, policyName string, input CreatePolicyInput, options *ReplicationPoliciesClientBeginCreateOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationPoliciesClient) create(ctx context.Context, resourceGroupName string, resourceName string, policyName string, input CreatePolicyInput, options *ReplicationPoliciesClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "ReplicationPoliciesClient.BeginCreate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, policyName, input, options) + req, err := client.createCreateRequest(ctx, resourceGroupName, resourceName, policyName, input, options) if err != nil { return nil, err } @@ -96,16 +96,16 @@ func (client *ReplicationPoliciesClient) create(ctx context.Context, resourceNam } // createCreateRequest creates the Create request. -func (client *ReplicationPoliciesClient) createCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, policyName string, input CreatePolicyInput, options *ReplicationPoliciesClientBeginCreateOptions) (*policy.Request, error) { +func (client *ReplicationPoliciesClient) createCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, policyName string, input CreatePolicyInput, options *ReplicationPoliciesClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -119,7 +119,7 @@ func (client *ReplicationPoliciesClient) createCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, input); err != nil { @@ -131,15 +131,15 @@ func (client *ReplicationPoliciesClient) createCreateRequest(ctx context.Context // BeginDelete - The operation to delete a replication policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - policyName - Replication policy name. // - options - ReplicationPoliciesClientBeginDeleteOptions contains the optional parameters for the ReplicationPoliciesClient.BeginDelete // method. -func (client *ReplicationPoliciesClient) BeginDelete(ctx context.Context, resourceName string, resourceGroupName string, policyName string, options *ReplicationPoliciesClientBeginDeleteOptions) (*runtime.Poller[ReplicationPoliciesClientDeleteResponse], error) { +func (client *ReplicationPoliciesClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, policyName string, options *ReplicationPoliciesClientBeginDeleteOptions) (*runtime.Poller[ReplicationPoliciesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceName, resourceGroupName, policyName, options) + resp, err := client.deleteOperation(ctx, resourceGroupName, resourceName, policyName, options) if err != nil { return nil, err } @@ -157,14 +157,14 @@ 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 2023-08-01 -func (client *ReplicationPoliciesClient) deleteOperation(ctx context.Context, resourceName string, resourceGroupName string, policyName string, options *ReplicationPoliciesClientBeginDeleteOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, policyName string, options *ReplicationPoliciesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ReplicationPoliciesClient.BeginDelete" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceName, resourceGroupName, policyName, options) + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, policyName, options) if err != nil { return nil, err } @@ -180,16 +180,16 @@ func (client *ReplicationPoliciesClient) deleteOperation(ctx context.Context, re } // deleteCreateRequest creates the Delete request. -func (client *ReplicationPoliciesClient) deleteCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, policyName string, options *ReplicationPoliciesClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ReplicationPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, policyName string, options *ReplicationPoliciesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -203,7 +203,7 @@ func (client *ReplicationPoliciesClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -211,18 +211,18 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - 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) { +func (client *ReplicationPoliciesClient) Get(ctx context.Context, resourceGroupName string, resourceName string, policyName string, options *ReplicationPoliciesClientGetOptions) (ReplicationPoliciesClientGetResponse, error) { var err error const operationName = "ReplicationPoliciesClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, policyName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, policyName, options) if err != nil { return ReplicationPoliciesClientGetResponse{}, err } @@ -239,16 +239,16 @@ func (client *ReplicationPoliciesClient) Get(ctx context.Context, resourceName s } // getCreateRequest creates the Get request. -func (client *ReplicationPoliciesClient) getCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, policyName string, options *ReplicationPoliciesClientGetOptions) (*policy.Request, error) { +func (client *ReplicationPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, policyName string, options *ReplicationPoliciesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -262,7 +262,7 @@ func (client *ReplicationPoliciesClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,12 +279,12 @@ func (client *ReplicationPoliciesClient) getHandleResponse(resp *http.Response) // NewListPager - Lists the replication policies for a vault. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - options - ReplicationPoliciesClientListOptions contains the optional parameters for the ReplicationPoliciesClient.NewListPager // method. -func (client *ReplicationPoliciesClient) NewListPager(resourceName string, resourceGroupName string, options *ReplicationPoliciesClientListOptions) *runtime.Pager[ReplicationPoliciesClientListResponse] { +func (client *ReplicationPoliciesClient) NewListPager(resourceGroupName string, resourceName string, options *ReplicationPoliciesClientListOptions) *runtime.Pager[ReplicationPoliciesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationPoliciesClientListResponse]{ More: func(page ReplicationPoliciesClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -296,7 +296,7 @@ func (client *ReplicationPoliciesClient) NewListPager(resourceName string, resou nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceName, resourceGroupName, options) + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) }, nil) if err != nil { return ReplicationPoliciesClientListResponse{}, err @@ -308,16 +308,16 @@ func (client *ReplicationPoliciesClient) NewListPager(resourceName string, resou } // listCreateRequest creates the List request. -func (client *ReplicationPoliciesClient) listCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, options *ReplicationPoliciesClientListOptions) (*policy.Request, error) { +func (client *ReplicationPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicationPoliciesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -327,7 +327,7 @@ func (client *ReplicationPoliciesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -345,16 +345,16 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - policyName - Policy Id. // - input - Update Policy Input. // - options - ReplicationPoliciesClientBeginUpdateOptions contains the optional parameters for the ReplicationPoliciesClient.BeginUpdate // method. -func (client *ReplicationPoliciesClient) BeginUpdate(ctx context.Context, resourceName string, resourceGroupName string, policyName string, input UpdatePolicyInput, options *ReplicationPoliciesClientBeginUpdateOptions) (*runtime.Poller[ReplicationPoliciesClientUpdateResponse], error) { +func (client *ReplicationPoliciesClient) BeginUpdate(ctx context.Context, resourceGroupName string, resourceName string, policyName string, input UpdatePolicyInput, options *ReplicationPoliciesClientBeginUpdateOptions) (*runtime.Poller[ReplicationPoliciesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceName, resourceGroupName, policyName, input, options) + resp, err := client.update(ctx, resourceGroupName, resourceName, policyName, input, options) if err != nil { return nil, err } @@ -372,14 +372,14 @@ 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 2023-08-01 -func (client *ReplicationPoliciesClient) update(ctx context.Context, resourceName string, resourceGroupName string, policyName string, input UpdatePolicyInput, options *ReplicationPoliciesClientBeginUpdateOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationPoliciesClient) update(ctx context.Context, resourceGroupName string, resourceName string, policyName string, input UpdatePolicyInput, options *ReplicationPoliciesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ReplicationPoliciesClient.BeginUpdate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceName, resourceGroupName, policyName, input, options) + req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, policyName, input, options) if err != nil { return nil, err } @@ -395,16 +395,16 @@ func (client *ReplicationPoliciesClient) update(ctx context.Context, resourceNam } // updateCreateRequest creates the Update request. -func (client *ReplicationPoliciesClient) updateCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, policyName string, input UpdatePolicyInput, options *ReplicationPoliciesClientBeginUpdateOptions) (*policy.Request, error) { +func (client *ReplicationPoliciesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, policyName string, input UpdatePolicyInput, options *ReplicationPoliciesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -418,7 +418,7 @@ func (client *ReplicationPoliciesClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, input); err != 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 e2244006f2a6..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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 d2c63f924130..d55cf0367af6 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectableitems_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectableitems_client.go @@ -46,21 +46,21 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - protectionContainerName - Protection container name. // - protectableItemName - Protectable item name. // - 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) { +func (client *ReplicationProtectableItemsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, protectableItemName string, options *ReplicationProtectableItemsClientGetOptions) (ReplicationProtectableItemsClientGetResponse, error) { var err error const operationName = "ReplicationProtectableItemsClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, protectableItemName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, protectableItemName, options) if err != nil { return ReplicationProtectableItemsClientGetResponse{}, err } @@ -77,16 +77,16 @@ func (client *ReplicationProtectableItemsClient) Get(ctx context.Context, resour } // getCreateRequest creates the Get request. -func (client *ReplicationProtectableItemsClient) getCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, protectableItemName string, options *ReplicationProtectableItemsClientGetOptions) (*policy.Request, error) { +func (client *ReplicationProtectableItemsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, protectableItemName string, options *ReplicationProtectableItemsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems/{protectableItemName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -108,7 +108,7 @@ func (client *ReplicationProtectableItemsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -125,14 +125,14 @@ func (client *ReplicationProtectableItemsClient) getHandleResponse(resp *http.Re // NewListByReplicationProtectionContainersPager - Lists the protectable items in a protection container. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - protectionContainerName - Protection container name. // - options - ReplicationProtectableItemsClientListByReplicationProtectionContainersOptions contains the optional parameters // for the ReplicationProtectableItemsClient.NewListByReplicationProtectionContainersPager method. -func (client *ReplicationProtectableItemsClient) NewListByReplicationProtectionContainersPager(resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, options *ReplicationProtectableItemsClientListByReplicationProtectionContainersOptions) *runtime.Pager[ReplicationProtectableItemsClientListByReplicationProtectionContainersResponse] { +func (client *ReplicationProtectableItemsClient) NewListByReplicationProtectionContainersPager(resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, options *ReplicationProtectableItemsClientListByReplicationProtectionContainersOptions) *runtime.Pager[ReplicationProtectableItemsClientListByReplicationProtectionContainersResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationProtectableItemsClientListByReplicationProtectionContainersResponse]{ More: func(page ReplicationProtectableItemsClientListByReplicationProtectionContainersResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -144,7 +144,7 @@ func (client *ReplicationProtectableItemsClient) NewListByReplicationProtectionC nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByReplicationProtectionContainersCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, options) + return client.listByReplicationProtectionContainersCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, options) }, nil) if err != nil { return ReplicationProtectableItemsClientListByReplicationProtectionContainersResponse{}, err @@ -156,16 +156,16 @@ func (client *ReplicationProtectableItemsClient) NewListByReplicationProtectionC } // listByReplicationProtectionContainersCreateRequest creates the ListByReplicationProtectionContainers request. -func (client *ReplicationProtectableItemsClient) listByReplicationProtectionContainersCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, options *ReplicationProtectableItemsClientListByReplicationProtectionContainersOptions) (*policy.Request, error) { +func (client *ReplicationProtectableItemsClient) listByReplicationProtectionContainersCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, options *ReplicationProtectableItemsClientListByReplicationProtectionContainersOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -192,7 +192,7 @@ func (client *ReplicationProtectableItemsClient) listByReplicationProtectionCont if options != nil && options.Take != nil { reqQP.Set("$take", *options.Take) } - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil 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 cc4e6153a286..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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 3d5f808f2ee8..707dd03ed48e 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotecteditems_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotecteditems_client.go @@ -46,18 +46,18 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Unique fabric name. // - protectionContainerName - Protection container name. // - replicatedProtectedItemName - Replication protected item name. // - addDisksInput - Add disks input. // - options - ReplicationProtectedItemsClientBeginAddDisksOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginAddDisks // method. -func (client *ReplicationProtectedItemsClient) BeginAddDisks(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput AddDisksInput, options *ReplicationProtectedItemsClientBeginAddDisksOptions) (*runtime.Poller[ReplicationProtectedItemsClientAddDisksResponse], error) { +func (client *ReplicationProtectedItemsClient) BeginAddDisks(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput AddDisksInput, options *ReplicationProtectedItemsClientBeginAddDisksOptions) (*runtime.Poller[ReplicationProtectedItemsClientAddDisksResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.addDisks(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, addDisksInput, options) + resp, err := client.addDisks(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, addDisksInput, options) if err != nil { return nil, err } @@ -75,14 +75,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectedItemsClient) addDisks(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput AddDisksInput, options *ReplicationProtectedItemsClientBeginAddDisksOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectedItemsClient.BeginAddDisks" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.addDisksCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, addDisksInput, options) + req, err := client.addDisksCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, addDisksInput, options) if err != nil { return nil, err } @@ -98,16 +98,16 @@ func (client *ReplicationProtectedItemsClient) addDisks(ctx context.Context, res } // addDisksCreateRequest creates the AddDisks request. -func (client *ReplicationProtectedItemsClient) addDisksCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput AddDisksInput, options *ReplicationProtectedItemsClientBeginAddDisksOptions) (*policy.Request, error) { +func (client *ReplicationProtectedItemsClient) addDisksCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, addDisksInput AddDisksInput, options *ReplicationProtectedItemsClientBeginAddDisksOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/addDisks" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -129,7 +129,7 @@ func (client *ReplicationProtectedItemsClient) addDisksCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, addDisksInput); err != nil { @@ -141,18 +141,18 @@ func (client *ReplicationProtectedItemsClient) addDisksCreateRequest(ctx context // 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - The ARM fabric name. // - protectionContainerName - The protection container name. // - replicatedProtectedItemName - The replicated protected item name. // - applyRecoveryPointInput - The ApplyRecoveryPointInput. // - options - ReplicationProtectedItemsClientBeginApplyRecoveryPointOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginApplyRecoveryPoint // method. -func (client *ReplicationProtectedItemsClient) BeginApplyRecoveryPoint(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput ApplyRecoveryPointInput, options *ReplicationProtectedItemsClientBeginApplyRecoveryPointOptions) (*runtime.Poller[ReplicationProtectedItemsClientApplyRecoveryPointResponse], error) { +func (client *ReplicationProtectedItemsClient) BeginApplyRecoveryPoint(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput ApplyRecoveryPointInput, options *ReplicationProtectedItemsClientBeginApplyRecoveryPointOptions) (*runtime.Poller[ReplicationProtectedItemsClientApplyRecoveryPointResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.applyRecoveryPoint(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, applyRecoveryPointInput, options) + resp, err := client.applyRecoveryPoint(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, applyRecoveryPointInput, options) if err != nil { return nil, err } @@ -170,14 +170,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectedItemsClient) applyRecoveryPoint(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput ApplyRecoveryPointInput, options *ReplicationProtectedItemsClientBeginApplyRecoveryPointOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectedItemsClient.BeginApplyRecoveryPoint" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.applyRecoveryPointCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, applyRecoveryPointInput, options) + req, err := client.applyRecoveryPointCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, applyRecoveryPointInput, options) if err != nil { return nil, err } @@ -193,16 +193,16 @@ func (client *ReplicationProtectedItemsClient) applyRecoveryPoint(ctx context.Co } // applyRecoveryPointCreateRequest creates the ApplyRecoveryPoint request. -func (client *ReplicationProtectedItemsClient) applyRecoveryPointCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput ApplyRecoveryPointInput, options *ReplicationProtectedItemsClientBeginApplyRecoveryPointOptions) (*policy.Request, error) { +func (client *ReplicationProtectedItemsClient) applyRecoveryPointCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applyRecoveryPointInput ApplyRecoveryPointInput, options *ReplicationProtectedItemsClientBeginApplyRecoveryPointOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/applyRecoveryPoint" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -224,7 +224,7 @@ func (client *ReplicationProtectedItemsClient) applyRecoveryPointCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, applyRecoveryPointInput); err != nil { @@ -236,18 +236,18 @@ func (client *ReplicationProtectedItemsClient) applyRecoveryPointCreateRequest(c // 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Name of the fabric. // - protectionContainerName - Protection container name. // - replicatedProtectedItemName - A name for the replication protected item. // - input - Enable Protection Input. // - options - ReplicationProtectedItemsClientBeginCreateOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginCreate // method. -func (client *ReplicationProtectedItemsClient) BeginCreate(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input EnableProtectionInput, options *ReplicationProtectedItemsClientBeginCreateOptions) (*runtime.Poller[ReplicationProtectedItemsClientCreateResponse], error) { +func (client *ReplicationProtectedItemsClient) BeginCreate(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input EnableProtectionInput, options *ReplicationProtectedItemsClientBeginCreateOptions) (*runtime.Poller[ReplicationProtectedItemsClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, input, options) + resp, err := client.create(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, input, options) if err != nil { return nil, err } @@ -265,14 +265,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectedItemsClient) create(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input EnableProtectionInput, options *ReplicationProtectedItemsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectedItemsClient.BeginCreate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, input, options) + req, err := client.createCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, input, options) if err != nil { return nil, err } @@ -288,16 +288,16 @@ func (client *ReplicationProtectedItemsClient) create(ctx context.Context, resou } // createCreateRequest creates the Create request. -func (client *ReplicationProtectedItemsClient) createCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input EnableProtectionInput, options *ReplicationProtectedItemsClientBeginCreateOptions) (*policy.Request, error) { +func (client *ReplicationProtectedItemsClient) createCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, input EnableProtectionInput, options *ReplicationProtectedItemsClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -319,7 +319,7 @@ func (client *ReplicationProtectedItemsClient) createCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, input); err != nil { @@ -331,18 +331,18 @@ func (client *ReplicationProtectedItemsClient) createCreateRequest(ctx context.C // 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - protectionContainerName - Protection container name. // - replicatedProtectedItemName - Replication protected item name. // - disableProtectionInput - Disable protection input. // - options - ReplicationProtectedItemsClientBeginDeleteOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginDelete // method. -func (client *ReplicationProtectedItemsClient) BeginDelete(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput DisableProtectionInput, options *ReplicationProtectedItemsClientBeginDeleteOptions) (*runtime.Poller[ReplicationProtectedItemsClientDeleteResponse], error) { +func (client *ReplicationProtectedItemsClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput DisableProtectionInput, options *ReplicationProtectedItemsClientBeginDeleteOptions) (*runtime.Poller[ReplicationProtectedItemsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, disableProtectionInput, options) + resp, err := client.deleteOperation(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, disableProtectionInput, options) if err != nil { return nil, err } @@ -360,14 +360,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectedItemsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput DisableProtectionInput, options *ReplicationProtectedItemsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectedItemsClient.BeginDelete" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, disableProtectionInput, options) + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, disableProtectionInput, options) if err != nil { return nil, err } @@ -383,16 +383,16 @@ func (client *ReplicationProtectedItemsClient) deleteOperation(ctx context.Conte } // deleteCreateRequest creates the Delete request. -func (client *ReplicationProtectedItemsClient) deleteCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput DisableProtectionInput, options *ReplicationProtectedItemsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ReplicationProtectedItemsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, disableProtectionInput DisableProtectionInput, options *ReplicationProtectedItemsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/remove" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -414,7 +414,7 @@ func (client *ReplicationProtectedItemsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() if err := runtime.MarshalAsJSON(req, disableProtectionInput); err != nil { return nil, err @@ -425,17 +425,17 @@ func (client *ReplicationProtectedItemsClient) deleteCreateRequest(ctx context.C // 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Unique fabric name. // - protectionContainerName - Protection container name. // - replicatedProtectedItemName - Replication protected item name. // - options - ReplicationProtectedItemsClientBeginFailoverCancelOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginFailoverCancel // method. -func (client *ReplicationProtectedItemsClient) BeginFailoverCancel(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginFailoverCancelOptions) (*runtime.Poller[ReplicationProtectedItemsClientFailoverCancelResponse], error) { +func (client *ReplicationProtectedItemsClient) BeginFailoverCancel(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginFailoverCancelOptions) (*runtime.Poller[ReplicationProtectedItemsClientFailoverCancelResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.failoverCancel(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, options) + resp, err := client.failoverCancel(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, options) if err != nil { return nil, err } @@ -453,14 +453,14 @@ 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 2023-08-01 -func (client *ReplicationProtectedItemsClient) failoverCancel(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginFailoverCancelOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectedItemsClient) failoverCancel(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginFailoverCancelOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectedItemsClient.BeginFailoverCancel" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.failoverCancelCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, options) + req, err := client.failoverCancelCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, options) if err != nil { return nil, err } @@ -476,16 +476,16 @@ func (client *ReplicationProtectedItemsClient) failoverCancel(ctx context.Contex } // failoverCancelCreateRequest creates the FailoverCancel request. -func (client *ReplicationProtectedItemsClient) failoverCancelCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginFailoverCancelOptions) (*policy.Request, error) { +func (client *ReplicationProtectedItemsClient) failoverCancelCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginFailoverCancelOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCancel" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -507,7 +507,7 @@ func (client *ReplicationProtectedItemsClient) failoverCancelCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -516,17 +516,17 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Unique fabric name. // - protectionContainerName - Protection container name. // - replicatedProtectedItemName - Replication protected item name. // - options - ReplicationProtectedItemsClientBeginFailoverCommitOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginFailoverCommit // method. -func (client *ReplicationProtectedItemsClient) BeginFailoverCommit(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginFailoverCommitOptions) (*runtime.Poller[ReplicationProtectedItemsClientFailoverCommitResponse], error) { +func (client *ReplicationProtectedItemsClient) BeginFailoverCommit(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginFailoverCommitOptions) (*runtime.Poller[ReplicationProtectedItemsClientFailoverCommitResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.failoverCommit(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, options) + resp, err := client.failoverCommit(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, options) if err != nil { return nil, err } @@ -544,14 +544,14 @@ 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 2023-08-01 -func (client *ReplicationProtectedItemsClient) failoverCommit(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginFailoverCommitOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectedItemsClient) failoverCommit(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginFailoverCommitOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectedItemsClient.BeginFailoverCommit" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.failoverCommitCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, options) + req, err := client.failoverCommitCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, options) if err != nil { return nil, err } @@ -567,16 +567,16 @@ func (client *ReplicationProtectedItemsClient) failoverCommit(ctx context.Contex } // failoverCommitCreateRequest creates the FailoverCommit request. -func (client *ReplicationProtectedItemsClient) failoverCommitCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginFailoverCommitOptions) (*policy.Request, error) { +func (client *ReplicationProtectedItemsClient) failoverCommitCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginFailoverCommitOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCommit" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -598,7 +598,7 @@ func (client *ReplicationProtectedItemsClient) failoverCommitCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -607,21 +607,21 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric unique name. // - protectionContainerName - Protection container name. // - replicatedProtectedItemName - Replication protected item name. // - 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) { +func (client *ReplicationProtectedItemsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientGetOptions) (ReplicationProtectedItemsClientGetResponse, error) { var err error const operationName = "ReplicationProtectedItemsClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, options) if err != nil { return ReplicationProtectedItemsClientGetResponse{}, err } @@ -638,16 +638,16 @@ func (client *ReplicationProtectedItemsClient) Get(ctx context.Context, resource } // getCreateRequest creates the Get request. -func (client *ReplicationProtectedItemsClient) getCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientGetOptions) (*policy.Request, error) { +func (client *ReplicationProtectedItemsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -669,7 +669,7 @@ func (client *ReplicationProtectedItemsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -686,12 +686,12 @@ func (client *ReplicationProtectedItemsClient) getHandleResponse(resp *http.Resp // NewListPager - Gets the list of ASR replication protected items in the vault. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - options - ReplicationProtectedItemsClientListOptions contains the optional parameters for the ReplicationProtectedItemsClient.NewListPager // method. -func (client *ReplicationProtectedItemsClient) NewListPager(resourceName string, resourceGroupName string, options *ReplicationProtectedItemsClientListOptions) *runtime.Pager[ReplicationProtectedItemsClientListResponse] { +func (client *ReplicationProtectedItemsClient) NewListPager(resourceGroupName string, resourceName string, options *ReplicationProtectedItemsClientListOptions) *runtime.Pager[ReplicationProtectedItemsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationProtectedItemsClientListResponse]{ More: func(page ReplicationProtectedItemsClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -703,7 +703,7 @@ func (client *ReplicationProtectedItemsClient) NewListPager(resourceName string, nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceName, resourceGroupName, options) + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) }, nil) if err != nil { return ReplicationProtectedItemsClientListResponse{}, err @@ -715,16 +715,16 @@ func (client *ReplicationProtectedItemsClient) NewListPager(resourceName string, } // listCreateRequest creates the List request. -func (client *ReplicationProtectedItemsClient) listCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, options *ReplicationProtectedItemsClientListOptions) (*policy.Request, error) { +func (client *ReplicationProtectedItemsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicationProtectedItemsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectedItems" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -737,7 +737,7 @@ func (client *ReplicationProtectedItemsClient) listCreateRequest(ctx context.Con if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") if options != nil && options.SkipToken != nil { reqQP.Set("skipToken", *options.SkipToken) } @@ -757,14 +757,14 @@ func (client *ReplicationProtectedItemsClient) listHandleResponse(resp *http.Res // NewListByReplicationProtectionContainersPager - Gets the list of ASR replication protected items in the protection container. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - protectionContainerName - Protection container name. // - options - ReplicationProtectedItemsClientListByReplicationProtectionContainersOptions contains the optional parameters // for the ReplicationProtectedItemsClient.NewListByReplicationProtectionContainersPager method. -func (client *ReplicationProtectedItemsClient) NewListByReplicationProtectionContainersPager(resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, options *ReplicationProtectedItemsClientListByReplicationProtectionContainersOptions) *runtime.Pager[ReplicationProtectedItemsClientListByReplicationProtectionContainersResponse] { +func (client *ReplicationProtectedItemsClient) NewListByReplicationProtectionContainersPager(resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, options *ReplicationProtectedItemsClientListByReplicationProtectionContainersOptions) *runtime.Pager[ReplicationProtectedItemsClientListByReplicationProtectionContainersResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationProtectedItemsClientListByReplicationProtectionContainersResponse]{ More: func(page ReplicationProtectedItemsClientListByReplicationProtectionContainersResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -776,7 +776,7 @@ func (client *ReplicationProtectedItemsClient) NewListByReplicationProtectionCon nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByReplicationProtectionContainersCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, options) + return client.listByReplicationProtectionContainersCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, options) }, nil) if err != nil { return ReplicationProtectedItemsClientListByReplicationProtectionContainersResponse{}, err @@ -788,16 +788,16 @@ func (client *ReplicationProtectedItemsClient) NewListByReplicationProtectionCon } // listByReplicationProtectionContainersCreateRequest creates the ListByReplicationProtectionContainers request. -func (client *ReplicationProtectedItemsClient) listByReplicationProtectionContainersCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, options *ReplicationProtectedItemsClientListByReplicationProtectionContainersOptions) (*policy.Request, error) { +func (client *ReplicationProtectedItemsClient) listByReplicationProtectionContainersCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, options *ReplicationProtectedItemsClientListByReplicationProtectionContainersOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -815,7 +815,7 @@ func (client *ReplicationProtectedItemsClient) listByReplicationProtectionContai return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -833,18 +833,18 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Unique fabric name. // - protectionContainerName - Protection container name. // - replicatedProtectedItemName - Replication protected item name. // - failoverInput - Planned failover input. // - options - ReplicationProtectedItemsClientBeginPlannedFailoverOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginPlannedFailover // method. -func (client *ReplicationProtectedItemsClient) BeginPlannedFailover(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput PlannedFailoverInput, options *ReplicationProtectedItemsClientBeginPlannedFailoverOptions) (*runtime.Poller[ReplicationProtectedItemsClientPlannedFailoverResponse], error) { +func (client *ReplicationProtectedItemsClient) BeginPlannedFailover(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput PlannedFailoverInput, options *ReplicationProtectedItemsClientBeginPlannedFailoverOptions) (*runtime.Poller[ReplicationProtectedItemsClientPlannedFailoverResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.plannedFailover(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput, options) + resp, err := client.plannedFailover(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput, options) if err != nil { return nil, err } @@ -862,14 +862,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectedItemsClient) plannedFailover(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput PlannedFailoverInput, options *ReplicationProtectedItemsClientBeginPlannedFailoverOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectedItemsClient.BeginPlannedFailover" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.plannedFailoverCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput, options) + req, err := client.plannedFailoverCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput, options) if err != nil { return nil, err } @@ -885,16 +885,16 @@ func (client *ReplicationProtectedItemsClient) plannedFailover(ctx context.Conte } // plannedFailoverCreateRequest creates the PlannedFailover request. -func (client *ReplicationProtectedItemsClient) plannedFailoverCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput PlannedFailoverInput, options *ReplicationProtectedItemsClientBeginPlannedFailoverOptions) (*policy.Request, error) { +func (client *ReplicationProtectedItemsClient) plannedFailoverCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput PlannedFailoverInput, options *ReplicationProtectedItemsClientBeginPlannedFailoverOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/plannedFailover" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -916,7 +916,7 @@ func (client *ReplicationProtectedItemsClient) plannedFailoverCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, failoverInput); err != nil { @@ -930,17 +930,17 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - protectionContainerName - Protection container name. // - replicatedProtectedItemName - Replication protected item name. // - options - ReplicationProtectedItemsClientBeginPurgeOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginPurge // method. -func (client *ReplicationProtectedItemsClient) BeginPurge(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginPurgeOptions) (*runtime.Poller[ReplicationProtectedItemsClientPurgeResponse], error) { +func (client *ReplicationProtectedItemsClient) BeginPurge(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginPurgeOptions) (*runtime.Poller[ReplicationProtectedItemsClientPurgeResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.purge(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, options) + resp, err := client.purge(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, options) if err != nil { return nil, err } @@ -960,14 +960,14 @@ 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 2023-08-01 -func (client *ReplicationProtectedItemsClient) purge(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginPurgeOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectedItemsClient) purge(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginPurgeOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectedItemsClient.BeginPurge" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.purgeCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, options) + req, err := client.purgeCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, options) if err != nil { return nil, err } @@ -983,16 +983,16 @@ func (client *ReplicationProtectedItemsClient) purge(ctx context.Context, resour } // purgeCreateRequest creates the Purge request. -func (client *ReplicationProtectedItemsClient) purgeCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginPurgeOptions) (*policy.Request, error) { +func (client *ReplicationProtectedItemsClient) purgeCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginPurgeOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -1014,7 +1014,7 @@ func (client *ReplicationProtectedItemsClient) purgeCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -1022,18 +1022,18 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Unique fabric name. // - protectionContainerName - Protection container name. // - replicatedProtectedItemName - Replication protected item name. // - removeDisksInput - Remove disks input. // - options - ReplicationProtectedItemsClientBeginRemoveDisksOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginRemoveDisks // method. -func (client *ReplicationProtectedItemsClient) BeginRemoveDisks(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput RemoveDisksInput, options *ReplicationProtectedItemsClientBeginRemoveDisksOptions) (*runtime.Poller[ReplicationProtectedItemsClientRemoveDisksResponse], error) { +func (client *ReplicationProtectedItemsClient) BeginRemoveDisks(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput RemoveDisksInput, options *ReplicationProtectedItemsClientBeginRemoveDisksOptions) (*runtime.Poller[ReplicationProtectedItemsClientRemoveDisksResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.removeDisks(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, removeDisksInput, options) + resp, err := client.removeDisks(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, removeDisksInput, options) if err != nil { return nil, err } @@ -1051,14 +1051,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectedItemsClient) removeDisks(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput RemoveDisksInput, options *ReplicationProtectedItemsClientBeginRemoveDisksOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectedItemsClient.BeginRemoveDisks" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.removeDisksCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, removeDisksInput, options) + req, err := client.removeDisksCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, removeDisksInput, options) if err != nil { return nil, err } @@ -1074,16 +1074,16 @@ func (client *ReplicationProtectedItemsClient) removeDisks(ctx context.Context, } // removeDisksCreateRequest creates the RemoveDisks request. -func (client *ReplicationProtectedItemsClient) removeDisksCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput RemoveDisksInput, options *ReplicationProtectedItemsClientBeginRemoveDisksOptions) (*policy.Request, error) { +func (client *ReplicationProtectedItemsClient) removeDisksCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, removeDisksInput RemoveDisksInput, options *ReplicationProtectedItemsClientBeginRemoveDisksOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/removeDisks" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -1105,7 +1105,7 @@ func (client *ReplicationProtectedItemsClient) removeDisksCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, removeDisksInput); err != nil { @@ -1118,17 +1118,17 @@ func (client *ReplicationProtectedItemsClient) removeDisksCreateRequest(ctx cont // resynchronization. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - The name of the fabric. // - protectionContainerName - The name of the container. // - replicatedProtectedItemName - The name of the replication protected item. // - options - ReplicationProtectedItemsClientBeginRepairReplicationOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginRepairReplication // method. -func (client *ReplicationProtectedItemsClient) BeginRepairReplication(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginRepairReplicationOptions) (*runtime.Poller[ReplicationProtectedItemsClientRepairReplicationResponse], error) { +func (client *ReplicationProtectedItemsClient) BeginRepairReplication(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginRepairReplicationOptions) (*runtime.Poller[ReplicationProtectedItemsClientRepairReplicationResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.repairReplication(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, options) + resp, err := client.repairReplication(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, options) if err != nil { return nil, err } @@ -1147,14 +1147,14 @@ func (client *ReplicationProtectedItemsClient) BeginRepairReplication(ctx contex // resynchronization. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 -func (client *ReplicationProtectedItemsClient) repairReplication(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginRepairReplicationOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectedItemsClient) repairReplication(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginRepairReplicationOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectedItemsClient.BeginRepairReplication" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.repairReplicationCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, options) + req, err := client.repairReplicationCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, options) if err != nil { return nil, err } @@ -1170,16 +1170,16 @@ func (client *ReplicationProtectedItemsClient) repairReplication(ctx context.Con } // repairReplicationCreateRequest creates the RepairReplication request. -func (client *ReplicationProtectedItemsClient) repairReplicationCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginRepairReplicationOptions) (*policy.Request, error) { +func (client *ReplicationProtectedItemsClient) repairReplicationCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *ReplicationProtectedItemsClientBeginRepairReplicationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/repairReplication" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -1201,7 +1201,7 @@ func (client *ReplicationProtectedItemsClient) repairReplicationCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1210,18 +1210,18 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Unique fabric name. // - protectionContainerName - Protection container name. // - replicatedProtectedItemName - Replication protected item name. // - reprotectInput - Reverse replication input. // - options - ReplicationProtectedItemsClientBeginReprotectOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginReprotect // method. -func (client *ReplicationProtectedItemsClient) BeginReprotect(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput ReverseReplicationInput, options *ReplicationProtectedItemsClientBeginReprotectOptions) (*runtime.Poller[ReplicationProtectedItemsClientReprotectResponse], error) { +func (client *ReplicationProtectedItemsClient) BeginReprotect(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput ReverseReplicationInput, options *ReplicationProtectedItemsClientBeginReprotectOptions) (*runtime.Poller[ReplicationProtectedItemsClientReprotectResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.reprotect(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, reprotectInput, options) + resp, err := client.reprotect(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, reprotectInput, options) if err != nil { return nil, err } @@ -1239,14 +1239,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectedItemsClient) reprotect(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput ReverseReplicationInput, options *ReplicationProtectedItemsClientBeginReprotectOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectedItemsClient.BeginReprotect" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.reprotectCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, reprotectInput, options) + req, err := client.reprotectCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, reprotectInput, options) if err != nil { return nil, err } @@ -1262,16 +1262,16 @@ func (client *ReplicationProtectedItemsClient) reprotect(ctx context.Context, re } // reprotectCreateRequest creates the Reprotect request. -func (client *ReplicationProtectedItemsClient) reprotectCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput ReverseReplicationInput, options *ReplicationProtectedItemsClientBeginReprotectOptions) (*policy.Request, error) { +func (client *ReplicationProtectedItemsClient) reprotectCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, reprotectInput ReverseReplicationInput, options *ReplicationProtectedItemsClientBeginReprotectOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/reProtect" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -1293,7 +1293,7 @@ func (client *ReplicationProtectedItemsClient) reprotectCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, reprotectInput); err != nil { @@ -1305,18 +1305,18 @@ func (client *ReplicationProtectedItemsClient) reprotectCreateRequest(ctx contex // 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Unique fabric name. // - protectionContainerName - Protection container name. // - replicatedProtectedItemName - Replication protected item name. // - resolveHealthInput - Health issue input object. // - options - ReplicationProtectedItemsClientBeginResolveHealthErrorsOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginResolveHealthErrors // method. -func (client *ReplicationProtectedItemsClient) BeginResolveHealthErrors(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput ResolveHealthInput, options *ReplicationProtectedItemsClientBeginResolveHealthErrorsOptions) (*runtime.Poller[ReplicationProtectedItemsClientResolveHealthErrorsResponse], error) { +func (client *ReplicationProtectedItemsClient) BeginResolveHealthErrors(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput ResolveHealthInput, options *ReplicationProtectedItemsClientBeginResolveHealthErrorsOptions) (*runtime.Poller[ReplicationProtectedItemsClientResolveHealthErrorsResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.resolveHealthErrors(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, resolveHealthInput, options) + resp, err := client.resolveHealthErrors(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, resolveHealthInput, options) if err != nil { return nil, err } @@ -1334,14 +1334,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectedItemsClient) resolveHealthErrors(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput ResolveHealthInput, options *ReplicationProtectedItemsClientBeginResolveHealthErrorsOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectedItemsClient.BeginResolveHealthErrors" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.resolveHealthErrorsCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, resolveHealthInput, options) + req, err := client.resolveHealthErrorsCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, resolveHealthInput, options) if err != nil { return nil, err } @@ -1357,16 +1357,16 @@ func (client *ReplicationProtectedItemsClient) resolveHealthErrors(ctx context.C } // resolveHealthErrorsCreateRequest creates the ResolveHealthErrors request. -func (client *ReplicationProtectedItemsClient) resolveHealthErrorsCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput ResolveHealthInput, options *ReplicationProtectedItemsClientBeginResolveHealthErrorsOptions) (*policy.Request, error) { +func (client *ReplicationProtectedItemsClient) resolveHealthErrorsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, resolveHealthInput ResolveHealthInput, options *ReplicationProtectedItemsClientBeginResolveHealthErrorsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/resolveHealthErrors" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -1388,7 +1388,7 @@ func (client *ReplicationProtectedItemsClient) resolveHealthErrorsCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resolveHealthInput); err != nil { @@ -1400,18 +1400,18 @@ func (client *ReplicationProtectedItemsClient) resolveHealthErrorsCreateRequest( // 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Unique fabric name. // - protectionContainerName - Protection container name. // - replicatedProtectedItemName - Replication protected item name. // - switchProviderInput - Switch provider input. // - options - ReplicationProtectedItemsClientBeginSwitchProviderOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginSwitchProvider // method. -func (client *ReplicationProtectedItemsClient) BeginSwitchProvider(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, switchProviderInput SwitchProviderInput, options *ReplicationProtectedItemsClientBeginSwitchProviderOptions) (*runtime.Poller[ReplicationProtectedItemsClientSwitchProviderResponse], error) { +func (client *ReplicationProtectedItemsClient) BeginSwitchProvider(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, switchProviderInput SwitchProviderInput, options *ReplicationProtectedItemsClientBeginSwitchProviderOptions) (*runtime.Poller[ReplicationProtectedItemsClientSwitchProviderResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.switchProvider(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, switchProviderInput, options) + resp, err := client.switchProvider(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, switchProviderInput, options) if err != nil { return nil, err } @@ -1430,14 +1430,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectedItemsClient) switchProvider(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, switchProviderInput SwitchProviderInput, options *ReplicationProtectedItemsClientBeginSwitchProviderOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectedItemsClient.BeginSwitchProvider" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.switchProviderCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, switchProviderInput, options) + req, err := client.switchProviderCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, switchProviderInput, options) if err != nil { return nil, err } @@ -1453,16 +1453,16 @@ func (client *ReplicationProtectedItemsClient) switchProvider(ctx context.Contex } // switchProviderCreateRequest creates the SwitchProvider request. -func (client *ReplicationProtectedItemsClient) switchProviderCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, switchProviderInput SwitchProviderInput, options *ReplicationProtectedItemsClientBeginSwitchProviderOptions) (*policy.Request, error) { +func (client *ReplicationProtectedItemsClient) switchProviderCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, switchProviderInput SwitchProviderInput, options *ReplicationProtectedItemsClientBeginSwitchProviderOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/switchProvider" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -1484,7 +1484,7 @@ func (client *ReplicationProtectedItemsClient) switchProviderCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, switchProviderInput); err != nil { @@ -1496,18 +1496,18 @@ func (client *ReplicationProtectedItemsClient) switchProviderCreateRequest(ctx c // 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Unique fabric name. // - protectionContainerName - Protection container name. // - replicatedProtectedItemName - Replication protected item name. // - testfailoverInput - Test failover input. // - options - ReplicationProtectedItemsClientBeginTestFailoverOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginTestFailover // method. -func (client *ReplicationProtectedItemsClient) BeginTestFailover(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput TestFailoverInput, options *ReplicationProtectedItemsClientBeginTestFailoverOptions) (*runtime.Poller[ReplicationProtectedItemsClientTestFailoverResponse], error) { +func (client *ReplicationProtectedItemsClient) BeginTestFailover(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput TestFailoverInput, options *ReplicationProtectedItemsClientBeginTestFailoverOptions) (*runtime.Poller[ReplicationProtectedItemsClientTestFailoverResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.testFailover(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, testfailoverInput, options) + resp, err := client.testFailover(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, testfailoverInput, options) if err != nil { return nil, err } @@ -1525,14 +1525,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectedItemsClient) testFailover(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput TestFailoverInput, options *ReplicationProtectedItemsClientBeginTestFailoverOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectedItemsClient.BeginTestFailover" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.testFailoverCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, testfailoverInput, options) + req, err := client.testFailoverCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, testfailoverInput, options) if err != nil { return nil, err } @@ -1548,16 +1548,16 @@ func (client *ReplicationProtectedItemsClient) testFailover(ctx context.Context, } // testFailoverCreateRequest creates the TestFailover request. -func (client *ReplicationProtectedItemsClient) testFailoverCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput TestFailoverInput, options *ReplicationProtectedItemsClientBeginTestFailoverOptions) (*policy.Request, error) { +func (client *ReplicationProtectedItemsClient) testFailoverCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, testfailoverInput TestFailoverInput, options *ReplicationProtectedItemsClientBeginTestFailoverOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailover" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -1579,7 +1579,7 @@ func (client *ReplicationProtectedItemsClient) testFailoverCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, testfailoverInput); err != nil { @@ -1591,18 +1591,18 @@ func (client *ReplicationProtectedItemsClient) testFailoverCreateRequest(ctx con // 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Unique fabric name. // - protectionContainerName - Protection container name. // - replicatedProtectedItemName - Replication protected item name. // - cleanupInput - Test failover cleanup input. // - options - ReplicationProtectedItemsClientBeginTestFailoverCleanupOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginTestFailoverCleanup // method. -func (client *ReplicationProtectedItemsClient) BeginTestFailoverCleanup(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput TestFailoverCleanupInput, options *ReplicationProtectedItemsClientBeginTestFailoverCleanupOptions) (*runtime.Poller[ReplicationProtectedItemsClientTestFailoverCleanupResponse], error) { +func (client *ReplicationProtectedItemsClient) BeginTestFailoverCleanup(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput TestFailoverCleanupInput, options *ReplicationProtectedItemsClientBeginTestFailoverCleanupOptions) (*runtime.Poller[ReplicationProtectedItemsClientTestFailoverCleanupResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.testFailoverCleanup(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, cleanupInput, options) + resp, err := client.testFailoverCleanup(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, cleanupInput, options) if err != nil { return nil, err } @@ -1620,14 +1620,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectedItemsClient) testFailoverCleanup(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput TestFailoverCleanupInput, options *ReplicationProtectedItemsClientBeginTestFailoverCleanupOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectedItemsClient.BeginTestFailoverCleanup" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.testFailoverCleanupCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, cleanupInput, options) + req, err := client.testFailoverCleanupCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, cleanupInput, options) if err != nil { return nil, err } @@ -1643,16 +1643,16 @@ func (client *ReplicationProtectedItemsClient) testFailoverCleanup(ctx context.C } // testFailoverCleanupCreateRequest creates the TestFailoverCleanup request. -func (client *ReplicationProtectedItemsClient) testFailoverCleanupCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput TestFailoverCleanupInput, options *ReplicationProtectedItemsClientBeginTestFailoverCleanupOptions) (*policy.Request, error) { +func (client *ReplicationProtectedItemsClient) testFailoverCleanupCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, cleanupInput TestFailoverCleanupInput, options *ReplicationProtectedItemsClientBeginTestFailoverCleanupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailoverCleanup" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -1674,7 +1674,7 @@ func (client *ReplicationProtectedItemsClient) testFailoverCleanupCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, cleanupInput); err != nil { @@ -1686,18 +1686,18 @@ func (client *ReplicationProtectedItemsClient) testFailoverCleanupCreateRequest( // 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Unique fabric name. // - protectionContainerName - Protection container name. // - replicatedProtectedItemName - Replication protected item name. // - failoverInput - Failover input. // - options - ReplicationProtectedItemsClientBeginUnplannedFailoverOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginUnplannedFailover // method. -func (client *ReplicationProtectedItemsClient) BeginUnplannedFailover(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput UnplannedFailoverInput, options *ReplicationProtectedItemsClientBeginUnplannedFailoverOptions) (*runtime.Poller[ReplicationProtectedItemsClientUnplannedFailoverResponse], error) { +func (client *ReplicationProtectedItemsClient) BeginUnplannedFailover(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput UnplannedFailoverInput, options *ReplicationProtectedItemsClientBeginUnplannedFailoverOptions) (*runtime.Poller[ReplicationProtectedItemsClientUnplannedFailoverResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.unplannedFailover(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput, options) + resp, err := client.unplannedFailover(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput, options) if err != nil { return nil, err } @@ -1715,14 +1715,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectedItemsClient) unplannedFailover(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput UnplannedFailoverInput, options *ReplicationProtectedItemsClientBeginUnplannedFailoverOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectedItemsClient.BeginUnplannedFailover" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.unplannedFailoverCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput, options) + req, err := client.unplannedFailoverCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, failoverInput, options) if err != nil { return nil, err } @@ -1738,16 +1738,16 @@ func (client *ReplicationProtectedItemsClient) unplannedFailover(ctx context.Con } // unplannedFailoverCreateRequest creates the UnplannedFailover request. -func (client *ReplicationProtectedItemsClient) unplannedFailoverCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput UnplannedFailoverInput, options *ReplicationProtectedItemsClientBeginUnplannedFailoverOptions) (*policy.Request, error) { +func (client *ReplicationProtectedItemsClient) unplannedFailoverCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, failoverInput UnplannedFailoverInput, options *ReplicationProtectedItemsClientBeginUnplannedFailoverOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/unplannedFailover" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -1769,7 +1769,7 @@ func (client *ReplicationProtectedItemsClient) unplannedFailoverCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, failoverInput); err != nil { @@ -1781,18 +1781,18 @@ func (client *ReplicationProtectedItemsClient) unplannedFailoverCreateRequest(ct // 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - protectionContainerName - Protection container name. // - replicatedProtectedItemName - Replication protected item name. // - updateProtectionInput - Update protection input. // - options - ReplicationProtectedItemsClientBeginUpdateOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginUpdate // method. -func (client *ReplicationProtectedItemsClient) BeginUpdate(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput UpdateReplicationProtectedItemInput, options *ReplicationProtectedItemsClientBeginUpdateOptions) (*runtime.Poller[ReplicationProtectedItemsClientUpdateResponse], error) { +func (client *ReplicationProtectedItemsClient) BeginUpdate(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput UpdateReplicationProtectedItemInput, options *ReplicationProtectedItemsClientBeginUpdateOptions) (*runtime.Poller[ReplicationProtectedItemsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, updateProtectionInput, options) + resp, err := client.update(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, updateProtectionInput, options) if err != nil { return nil, err } @@ -1810,14 +1810,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectedItemsClient) update(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput UpdateReplicationProtectedItemInput, options *ReplicationProtectedItemsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectedItemsClient.BeginUpdate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, updateProtectionInput, options) + req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, updateProtectionInput, options) if err != nil { return nil, err } @@ -1833,16 +1833,16 @@ func (client *ReplicationProtectedItemsClient) update(ctx context.Context, resou } // updateCreateRequest creates the Update request. -func (client *ReplicationProtectedItemsClient) updateCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput UpdateReplicationProtectedItemInput, options *ReplicationProtectedItemsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *ReplicationProtectedItemsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateProtectionInput UpdateReplicationProtectedItemInput, options *ReplicationProtectedItemsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -1864,7 +1864,7 @@ func (client *ReplicationProtectedItemsClient) updateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, updateProtectionInput); err != nil { @@ -1876,18 +1876,18 @@ func (client *ReplicationProtectedItemsClient) updateCreateRequest(ctx context.C // 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - protectionContainerName - Protection container name. // - replicatedProtectedItemName - Replication protected item name. // - applianceUpdateInput - Appliance update protection input. // - options - ReplicationProtectedItemsClientBeginUpdateApplianceOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginUpdateAppliance // method. -func (client *ReplicationProtectedItemsClient) BeginUpdateAppliance(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput UpdateApplianceForReplicationProtectedItemInput, options *ReplicationProtectedItemsClientBeginUpdateApplianceOptions) (*runtime.Poller[ReplicationProtectedItemsClientUpdateApplianceResponse], error) { +func (client *ReplicationProtectedItemsClient) BeginUpdateAppliance(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput UpdateApplianceForReplicationProtectedItemInput, options *ReplicationProtectedItemsClientBeginUpdateApplianceOptions) (*runtime.Poller[ReplicationProtectedItemsClientUpdateApplianceResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.updateAppliance(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, applianceUpdateInput, options) + resp, err := client.updateAppliance(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, applianceUpdateInput, options) if err != nil { return nil, err } @@ -1905,14 +1905,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectedItemsClient) updateAppliance(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput UpdateApplianceForReplicationProtectedItemInput, options *ReplicationProtectedItemsClientBeginUpdateApplianceOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectedItemsClient.BeginUpdateAppliance" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.updateApplianceCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, applianceUpdateInput, options) + req, err := client.updateApplianceCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, applianceUpdateInput, options) if err != nil { return nil, err } @@ -1928,16 +1928,16 @@ func (client *ReplicationProtectedItemsClient) updateAppliance(ctx context.Conte } // updateApplianceCreateRequest creates the UpdateAppliance request. -func (client *ReplicationProtectedItemsClient) updateApplianceCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput UpdateApplianceForReplicationProtectedItemInput, options *ReplicationProtectedItemsClientBeginUpdateApplianceOptions) (*policy.Request, error) { +func (client *ReplicationProtectedItemsClient) updateApplianceCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, applianceUpdateInput UpdateApplianceForReplicationProtectedItemInput, options *ReplicationProtectedItemsClientBeginUpdateApplianceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/updateAppliance" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -1959,7 +1959,7 @@ func (client *ReplicationProtectedItemsClient) updateApplianceCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, applianceUpdateInput); err != nil { @@ -1972,18 +1972,18 @@ func (client *ReplicationProtectedItemsClient) updateApplianceCreateRequest(ctx // protected item to the latest available version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - The name of the fabric containing the protected item. // - protectionContainerName - The name of the container containing the protected item. // - replicatedProtectedItemName - The name of the protected item on which the agent is to be updated. // - updateMobilityServiceRequest - Request to update the mobility service on the protected item. // - options - ReplicationProtectedItemsClientBeginUpdateMobilityServiceOptions contains the optional parameters for the ReplicationProtectedItemsClient.BeginUpdateMobilityService // method. -func (client *ReplicationProtectedItemsClient) BeginUpdateMobilityService(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateMobilityServiceRequest UpdateMobilityServiceRequest, options *ReplicationProtectedItemsClientBeginUpdateMobilityServiceOptions) (*runtime.Poller[ReplicationProtectedItemsClientUpdateMobilityServiceResponse], error) { +func (client *ReplicationProtectedItemsClient) BeginUpdateMobilityService(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateMobilityServiceRequest UpdateMobilityServiceRequest, options *ReplicationProtectedItemsClientBeginUpdateMobilityServiceOptions) (*runtime.Poller[ReplicationProtectedItemsClientUpdateMobilityServiceResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.updateMobilityService(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, updateMobilityServiceRequest, options) + resp, err := client.updateMobilityService(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, updateMobilityServiceRequest, options) if err != nil { return nil, err } @@ -2003,14 +2003,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectedItemsClient) updateMobilityService(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateMobilityServiceRequest UpdateMobilityServiceRequest, options *ReplicationProtectedItemsClientBeginUpdateMobilityServiceOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectedItemsClient.BeginUpdateMobilityService" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.updateMobilityServiceCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, updateMobilityServiceRequest, options) + req, err := client.updateMobilityServiceCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, updateMobilityServiceRequest, options) if err != nil { return nil, err } @@ -2026,16 +2026,16 @@ func (client *ReplicationProtectedItemsClient) updateMobilityService(ctx context } // updateMobilityServiceCreateRequest creates the UpdateMobilityService request. -func (client *ReplicationProtectedItemsClient) updateMobilityServiceCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateMobilityServiceRequest UpdateMobilityServiceRequest, options *ReplicationProtectedItemsClientBeginUpdateMobilityServiceOptions) (*policy.Request, error) { +func (client *ReplicationProtectedItemsClient) updateMobilityServiceCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, updateMobilityServiceRequest UpdateMobilityServiceRequest, options *ReplicationProtectedItemsClientBeginUpdateMobilityServiceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/updateMobilityService" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -2057,7 +2057,7 @@ func (client *ReplicationProtectedItemsClient) updateMobilityServiceCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, updateMobilityServiceRequest); err != 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 4c4301383eda..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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:01.000Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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:01.000Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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:01.000Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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:01.000Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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:01.000Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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:01.000Z"); 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.099Z"); return t}()), - // LastSuccessfulTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-25T09:57:57.035Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.135Z"); 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.157Z"); return t}()), - // LastSuccessfulTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1601-01-01T00:00:00.000Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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:01.000Z"); 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.157Z"); return t}()), - // LastSuccessfulTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-25T09:57:57.035Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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:01.000Z"); 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.157Z"); return t}()), - // LastSuccessfulTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-25T09:57:57.035Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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:01.000Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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:01.000Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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:01.000Z"); 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.157Z"); return t}()), - // LastSuccessfulTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-25T09:57:57.035Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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:01.000Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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:01.000Z"); 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.157Z"); return t}()), - // LastSuccessfulTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-25T09:57:57.035Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.035Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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:01.000Z"); 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.157Z"); return t}()), - // LastSuccessfulTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-25T09:57:57.035Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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:01.000Z"); 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.099Z"); return t}()), - // LastSuccessfulTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-25T09:57:57.035Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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:01.000Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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:01.000Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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:01.000Z"); 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/replicationprotectionclusters_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectionclusters_client.go new file mode 100644 index 000000000000..c84d106ff2d0 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectionclusters_client.go @@ -0,0 +1,1114 @@ +//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 + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ReplicationProtectionClustersClient contains the methods for the ReplicationProtectionClusters group. +// Don't use this type directly, use NewReplicationProtectionClustersClient() instead. +type ReplicationProtectionClustersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewReplicationProtectionClustersClient creates a new instance of ReplicationProtectionClustersClient with the specified values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewReplicationProtectionClustersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ReplicationProtectionClustersClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ReplicationProtectionClustersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginApplyRecoveryPoint - Operation to apply a new cluster recovery point on the Protection cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-01-01 +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. +// - fabricName - Fabric name. +// - protectionContainerName - Protection container name. +// - replicationProtectionClusterName - Replication protection cluster name. +// - applyClusterRecoveryPointInput - Apply recovery point input. +// - options - ReplicationProtectionClustersClientBeginApplyRecoveryPointOptions contains the optional parameters for the ReplicationProtectionClustersClient.BeginApplyRecoveryPoint +// method. +func (client *ReplicationProtectionClustersClient) BeginApplyRecoveryPoint(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, applyClusterRecoveryPointInput ApplyClusterRecoveryPointInput, options *ReplicationProtectionClustersClientBeginApplyRecoveryPointOptions) (*runtime.Poller[ReplicationProtectionClustersClientApplyRecoveryPointResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.applyRecoveryPoint(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, applyClusterRecoveryPointInput, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReplicationProtectionClustersClientApplyRecoveryPointResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ReplicationProtectionClustersClientApplyRecoveryPointResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// ApplyRecoveryPoint - Operation to apply a new cluster recovery point on the Protection cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-01-01 +func (client *ReplicationProtectionClustersClient) applyRecoveryPoint(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, applyClusterRecoveryPointInput ApplyClusterRecoveryPointInput, options *ReplicationProtectionClustersClientBeginApplyRecoveryPointOptions) (*http.Response, error) { + var err error + const operationName = "ReplicationProtectionClustersClient.BeginApplyRecoveryPoint" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.applyRecoveryPointCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, applyClusterRecoveryPointInput, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// applyRecoveryPointCreateRequest creates the ApplyRecoveryPoint request. +func (client *ReplicationProtectionClustersClient) applyRecoveryPointCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, applyClusterRecoveryPointInput ApplyClusterRecoveryPointInput, options *ReplicationProtectionClustersClientBeginApplyRecoveryPointOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/applyRecoveryPoint" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if fabricName == "" { + return nil, errors.New("parameter fabricName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{fabricName}", url.PathEscape(fabricName)) + if protectionContainerName == "" { + return nil, errors.New("parameter protectionContainerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{protectionContainerName}", url.PathEscape(protectionContainerName)) + if replicationProtectionClusterName == "" { + return nil, errors.New("parameter replicationProtectionClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{replicationProtectionClusterName}", url.PathEscape(replicationProtectionClusterName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, applyClusterRecoveryPointInput); err != nil { + return nil, err + } + return req, nil +} + +// BeginCreate - The operation to create an ASR replication protection cluster item. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-01-01 +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. +// - fabricName - Fabric name. +// - protectionContainerName - Protection container name. +// - replicationProtectionClusterName - Replication protection cluster name. +// - replicationProtectionCluster - Create replication protection cluster Input. +// - options - ReplicationProtectionClustersClientBeginCreateOptions contains the optional parameters for the ReplicationProtectionClustersClient.BeginCreate +// method. +func (client *ReplicationProtectionClustersClient) BeginCreate(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, replicationProtectionCluster ReplicationProtectionCluster, options *ReplicationProtectionClustersClientBeginCreateOptions) (*runtime.Poller[ReplicationProtectionClustersClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, replicationProtectionCluster, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReplicationProtectionClustersClientCreateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ReplicationProtectionClustersClientCreateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Create - The operation to create an ASR replication protection cluster item. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-01-01 +func (client *ReplicationProtectionClustersClient) create(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, replicationProtectionCluster ReplicationProtectionCluster, options *ReplicationProtectionClustersClientBeginCreateOptions) (*http.Response, error) { + var err error + const operationName = "ReplicationProtectionClustersClient.BeginCreate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, replicationProtectionCluster, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createCreateRequest creates the Create request. +func (client *ReplicationProtectionClustersClient) createCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, replicationProtectionCluster ReplicationProtectionCluster, options *ReplicationProtectionClustersClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if fabricName == "" { + return nil, errors.New("parameter fabricName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{fabricName}", url.PathEscape(fabricName)) + if protectionContainerName == "" { + return nil, errors.New("parameter protectionContainerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{protectionContainerName}", url.PathEscape(protectionContainerName)) + if replicationProtectionClusterName == "" { + return nil, errors.New("parameter replicationProtectionClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{replicationProtectionClusterName}", url.PathEscape(replicationProtectionClusterName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, replicationProtectionCluster); err != nil { + return nil, err + } + return req, nil +} + +// BeginFailoverCommit - Operation to initiate commit failover of the replication protection cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-01-01 +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. +// - fabricName - Fabric name. +// - protectionContainerName - Protection container name. +// - replicationProtectionClusterName - Replication protection cluster name. +// - options - ReplicationProtectionClustersClientBeginFailoverCommitOptions contains the optional parameters for the ReplicationProtectionClustersClient.BeginFailoverCommit +// method. +func (client *ReplicationProtectionClustersClient) BeginFailoverCommit(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, options *ReplicationProtectionClustersClientBeginFailoverCommitOptions) (*runtime.Poller[ReplicationProtectionClustersClientFailoverCommitResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.failoverCommit(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReplicationProtectionClustersClientFailoverCommitResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ReplicationProtectionClustersClientFailoverCommitResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// FailoverCommit - Operation to initiate commit failover of the replication protection cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-01-01 +func (client *ReplicationProtectionClustersClient) failoverCommit(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, options *ReplicationProtectionClustersClientBeginFailoverCommitOptions) (*http.Response, error) { + var err error + const operationName = "ReplicationProtectionClustersClient.BeginFailoverCommit" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.failoverCommitCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// failoverCommitCreateRequest creates the FailoverCommit request. +func (client *ReplicationProtectionClustersClient) failoverCommitCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, options *ReplicationProtectionClustersClientBeginFailoverCommitOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/failoverCommit" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if fabricName == "" { + return nil, errors.New("parameter fabricName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{fabricName}", url.PathEscape(fabricName)) + if protectionContainerName == "" { + return nil, errors.New("parameter protectionContainerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{protectionContainerName}", url.PathEscape(protectionContainerName)) + if replicationProtectionClusterName == "" { + return nil, errors.New("parameter replicationProtectionClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{replicationProtectionClusterName}", url.PathEscape(replicationProtectionClusterName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the details of an ASR replication protection cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-01-01 +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. +// - fabricName - Fabric name. +// - protectionContainerName - Protection container name. +// - replicationProtectionClusterName - Replication protection cluster name. +// - options - ReplicationProtectionClustersClientGetOptions contains the optional parameters for the ReplicationProtectionClustersClient.Get +// method. +func (client *ReplicationProtectionClustersClient) Get(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, options *ReplicationProtectionClustersClientGetOptions) (ReplicationProtectionClustersClientGetResponse, error) { + var err error + const operationName = "ReplicationProtectionClustersClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, options) + if err != nil { + return ReplicationProtectionClustersClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ReplicationProtectionClustersClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationProtectionClustersClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ReplicationProtectionClustersClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, options *ReplicationProtectionClustersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if fabricName == "" { + return nil, errors.New("parameter fabricName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{fabricName}", url.PathEscape(fabricName)) + if protectionContainerName == "" { + return nil, errors.New("parameter protectionContainerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{protectionContainerName}", url.PathEscape(protectionContainerName)) + if replicationProtectionClusterName == "" { + return nil, errors.New("parameter replicationProtectionClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{replicationProtectionClusterName}", url.PathEscape(replicationProtectionClusterName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ReplicationProtectionClustersClient) getHandleResponse(resp *http.Response) (ReplicationProtectionClustersClientGetResponse, error) { + result := ReplicationProtectionClustersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ReplicationProtectionCluster); err != nil { + return ReplicationProtectionClustersClientGetResponse{}, err + } + return result, nil +} + +// GetOperationResults - Track the results of an asynchronous operation on the replication protection cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-01-01 +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. +// - fabricName - Fabric name. +// - protectionContainerName - Protection container name. +// - replicationProtectionClusterName - Replication protection cluster name. +// - jobID - job id to track. +// - options - ReplicationProtectionClustersClientGetOperationResultsOptions contains the optional parameters for the ReplicationProtectionClustersClient.GetOperationResults +// method. +func (client *ReplicationProtectionClustersClient) GetOperationResults(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, jobID string, options *ReplicationProtectionClustersClientGetOperationResultsOptions) (ReplicationProtectionClustersClientGetOperationResultsResponse, error) { + var err error + const operationName = "ReplicationProtectionClustersClient.GetOperationResults" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getOperationResultsCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, jobID, options) + if err != nil { + return ReplicationProtectionClustersClientGetOperationResultsResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ReplicationProtectionClustersClientGetOperationResultsResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ReplicationProtectionClustersClientGetOperationResultsResponse{}, err + } + resp, err := client.getOperationResultsHandleResponse(httpResp) + return resp, err +} + +// getOperationResultsCreateRequest creates the GetOperationResults request. +func (client *ReplicationProtectionClustersClient) getOperationResultsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, jobID string, options *ReplicationProtectionClustersClientGetOperationResultsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/operationResults/{jobId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if fabricName == "" { + return nil, errors.New("parameter fabricName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{fabricName}", url.PathEscape(fabricName)) + if protectionContainerName == "" { + return nil, errors.New("parameter protectionContainerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{protectionContainerName}", url.PathEscape(protectionContainerName)) + if replicationProtectionClusterName == "" { + return nil, errors.New("parameter replicationProtectionClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{replicationProtectionClusterName}", url.PathEscape(replicationProtectionClusterName)) + if jobID == "" { + return nil, errors.New("parameter jobID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{jobId}", url.PathEscape(jobID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getOperationResultsHandleResponse handles the GetOperationResults response. +func (client *ReplicationProtectionClustersClient) getOperationResultsHandleResponse(resp *http.Response) (ReplicationProtectionClustersClientGetOperationResultsResponse, error) { + result := ReplicationProtectionClustersClientGetOperationResultsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ReplicationProtectionCluster); err != nil { + return ReplicationProtectionClustersClientGetOperationResultsResponse{}, err + } + return result, nil +} + +// NewListPager - Gets the list of ASR replication protected clusters in the vault. +// +// Generated from API version 2025-01-01 +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. +// - options - ReplicationProtectionClustersClientListOptions contains the optional parameters for the ReplicationProtectionClustersClient.NewListPager +// method. +func (client *ReplicationProtectionClustersClient) NewListPager(resourceGroupName string, resourceName string, options *ReplicationProtectionClustersClientListOptions) *runtime.Pager[ReplicationProtectionClustersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ReplicationProtectionClustersClientListResponse]{ + More: func(page ReplicationProtectionClustersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ReplicationProtectionClustersClientListResponse) (ReplicationProtectionClustersClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ReplicationProtectionClustersClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) + }, nil) + if err != nil { + return ReplicationProtectionClustersClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *ReplicationProtectionClustersClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicationProtectionClustersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionClusters" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + reqQP.Set("api-version", "2025-01-01") + if options != nil && options.SkipToken != nil { + reqQP.Set("skipToken", *options.SkipToken) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ReplicationProtectionClustersClient) listHandleResponse(resp *http.Response) (ReplicationProtectionClustersClientListResponse, error) { + result := ReplicationProtectionClustersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ReplicationProtectionClusterCollection); err != nil { + return ReplicationProtectionClustersClientListResponse{}, err + } + return result, nil +} + +// NewListByReplicationProtectionContainersPager - Gets the list of ASR replication protected clusters in the protection container. +// +// Generated from API version 2025-01-01 +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. +// - fabricName - Fabric name. +// - protectionContainerName - Protection container name. +// - options - ReplicationProtectionClustersClientListByReplicationProtectionContainersOptions contains the optional parameters +// for the ReplicationProtectionClustersClient.NewListByReplicationProtectionContainersPager method. +func (client *ReplicationProtectionClustersClient) NewListByReplicationProtectionContainersPager(resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, options *ReplicationProtectionClustersClientListByReplicationProtectionContainersOptions) *runtime.Pager[ReplicationProtectionClustersClientListByReplicationProtectionContainersResponse] { + return runtime.NewPager(runtime.PagingHandler[ReplicationProtectionClustersClientListByReplicationProtectionContainersResponse]{ + More: func(page ReplicationProtectionClustersClientListByReplicationProtectionContainersResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ReplicationProtectionClustersClientListByReplicationProtectionContainersResponse) (ReplicationProtectionClustersClientListByReplicationProtectionContainersResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ReplicationProtectionClustersClient.NewListByReplicationProtectionContainersPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByReplicationProtectionContainersCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, options) + }, nil) + if err != nil { + return ReplicationProtectionClustersClientListByReplicationProtectionContainersResponse{}, err + } + return client.listByReplicationProtectionContainersHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByReplicationProtectionContainersCreateRequest creates the ListByReplicationProtectionContainers request. +func (client *ReplicationProtectionClustersClient) listByReplicationProtectionContainersCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, options *ReplicationProtectionClustersClientListByReplicationProtectionContainersOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if fabricName == "" { + return nil, errors.New("parameter fabricName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{fabricName}", url.PathEscape(fabricName)) + if protectionContainerName == "" { + return nil, errors.New("parameter protectionContainerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{protectionContainerName}", url.PathEscape(protectionContainerName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByReplicationProtectionContainersHandleResponse handles the ListByReplicationProtectionContainers response. +func (client *ReplicationProtectionClustersClient) listByReplicationProtectionContainersHandleResponse(resp *http.Response) (ReplicationProtectionClustersClientListByReplicationProtectionContainersResponse, error) { + result := ReplicationProtectionClustersClientListByReplicationProtectionContainersResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ReplicationProtectionClusterCollection); err != nil { + return ReplicationProtectionClustersClientListByReplicationProtectionContainersResponse{}, err + } + return result, nil +} + +// BeginPurge - The operation to purge the replication protection cluster. This operation will force delete the replication +// protection cluster. Use the remove operation on replication protection cluster to perform a +// clean disable replication protection cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-01-01 +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. +// - fabricName - Fabric name. +// - protectionContainerName - Protection container name. +// - replicationProtectionClusterName - Replication protection cluster name. +// - options - ReplicationProtectionClustersClientBeginPurgeOptions contains the optional parameters for the ReplicationProtectionClustersClient.BeginPurge +// method. +func (client *ReplicationProtectionClustersClient) BeginPurge(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, options *ReplicationProtectionClustersClientBeginPurgeOptions) (*runtime.Poller[ReplicationProtectionClustersClientPurgeResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.purge(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReplicationProtectionClustersClientPurgeResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ReplicationProtectionClustersClientPurgeResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Purge - The operation to purge the replication protection cluster. This operation will force delete the replication protection +// cluster. Use the remove operation on replication protection cluster to perform a +// clean disable replication protection cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-01-01 +func (client *ReplicationProtectionClustersClient) purge(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, options *ReplicationProtectionClustersClientBeginPurgeOptions) (*http.Response, error) { + var err error + const operationName = "ReplicationProtectionClustersClient.BeginPurge" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.purgeCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// purgeCreateRequest creates the Purge request. +func (client *ReplicationProtectionClustersClient) purgeCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, options *ReplicationProtectionClustersClientBeginPurgeOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if fabricName == "" { + return nil, errors.New("parameter fabricName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{fabricName}", url.PathEscape(fabricName)) + if protectionContainerName == "" { + return nil, errors.New("parameter protectionContainerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{protectionContainerName}", url.PathEscape(protectionContainerName)) + if replicationProtectionClusterName == "" { + return nil, errors.New("parameter replicationProtectionClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{replicationProtectionClusterName}", url.PathEscape(replicationProtectionClusterName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginRepairReplication - The operation to repair replication protection cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-01-01 +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. +// - fabricName - Fabric name. +// - protectionContainerName - Protection container name. +// - replicationProtectionClusterName - Replication protection cluster name. +// - options - ReplicationProtectionClustersClientBeginRepairReplicationOptions contains the optional parameters for the ReplicationProtectionClustersClient.BeginRepairReplication +// method. +func (client *ReplicationProtectionClustersClient) BeginRepairReplication(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, options *ReplicationProtectionClustersClientBeginRepairReplicationOptions) (*runtime.Poller[ReplicationProtectionClustersClientRepairReplicationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.repairReplication(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReplicationProtectionClustersClientRepairReplicationResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ReplicationProtectionClustersClientRepairReplicationResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// RepairReplication - The operation to repair replication protection cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-01-01 +func (client *ReplicationProtectionClustersClient) repairReplication(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, options *ReplicationProtectionClustersClientBeginRepairReplicationOptions) (*http.Response, error) { + var err error + const operationName = "ReplicationProtectionClustersClient.BeginRepairReplication" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.repairReplicationCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// repairReplicationCreateRequest creates the RepairReplication request. +func (client *ReplicationProtectionClustersClient) repairReplicationCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, options *ReplicationProtectionClustersClientBeginRepairReplicationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/repairReplication" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if fabricName == "" { + return nil, errors.New("parameter fabricName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{fabricName}", url.PathEscape(fabricName)) + if protectionContainerName == "" { + return nil, errors.New("parameter protectionContainerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{protectionContainerName}", url.PathEscape(protectionContainerName)) + if replicationProtectionClusterName == "" { + return nil, errors.New("parameter replicationProtectionClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{replicationProtectionClusterName}", url.PathEscape(replicationProtectionClusterName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginTestFailover - Operation to initiate a failover of the replication protection cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-01-01 +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. +// - fabricName - Fabric name. +// - protectionContainerName - Protection container name. +// - replicationProtectionClusterName - Replication protection cluster name. +// - failoverInput - Cluster test failover input body. +// - options - ReplicationProtectionClustersClientBeginTestFailoverOptions contains the optional parameters for the ReplicationProtectionClustersClient.BeginTestFailover +// method. +func (client *ReplicationProtectionClustersClient) BeginTestFailover(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, failoverInput ClusterTestFailoverInput, options *ReplicationProtectionClustersClientBeginTestFailoverOptions) (*runtime.Poller[ReplicationProtectionClustersClientTestFailoverResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.testFailover(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, failoverInput, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReplicationProtectionClustersClientTestFailoverResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ReplicationProtectionClustersClientTestFailoverResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// TestFailover - Operation to initiate a failover of the replication protection cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-01-01 +func (client *ReplicationProtectionClustersClient) testFailover(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, failoverInput ClusterTestFailoverInput, options *ReplicationProtectionClustersClientBeginTestFailoverOptions) (*http.Response, error) { + var err error + const operationName = "ReplicationProtectionClustersClient.BeginTestFailover" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.testFailoverCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, failoverInput, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// testFailoverCreateRequest creates the TestFailover request. +func (client *ReplicationProtectionClustersClient) testFailoverCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, failoverInput ClusterTestFailoverInput, options *ReplicationProtectionClustersClientBeginTestFailoverOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/testFailover" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if fabricName == "" { + return nil, errors.New("parameter fabricName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{fabricName}", url.PathEscape(fabricName)) + if protectionContainerName == "" { + return nil, errors.New("parameter protectionContainerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{protectionContainerName}", url.PathEscape(protectionContainerName)) + if replicationProtectionClusterName == "" { + return nil, errors.New("parameter replicationProtectionClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{replicationProtectionClusterName}", url.PathEscape(replicationProtectionClusterName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, failoverInput); err != nil { + return nil, err + } + return req, nil +} + +// BeginTestFailoverCleanup - Operation to clean up the test failover of a replication protected cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-01-01 +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. +// - fabricName - Fabric name. +// - protectionContainerName - Protection container name. +// - replicationProtectionClusterName - Replication protection cluster name. +// - cleanupInput - Test failover cleanup input. +// - options - ReplicationProtectionClustersClientBeginTestFailoverCleanupOptions contains the optional parameters for the ReplicationProtectionClustersClient.BeginTestFailoverCleanup +// method. +func (client *ReplicationProtectionClustersClient) BeginTestFailoverCleanup(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, cleanupInput ClusterTestFailoverCleanupInput, options *ReplicationProtectionClustersClientBeginTestFailoverCleanupOptions) (*runtime.Poller[ReplicationProtectionClustersClientTestFailoverCleanupResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.testFailoverCleanup(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, cleanupInput, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReplicationProtectionClustersClientTestFailoverCleanupResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ReplicationProtectionClustersClientTestFailoverCleanupResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// TestFailoverCleanup - Operation to clean up the test failover of a replication protected cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-01-01 +func (client *ReplicationProtectionClustersClient) testFailoverCleanup(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, cleanupInput ClusterTestFailoverCleanupInput, options *ReplicationProtectionClustersClientBeginTestFailoverCleanupOptions) (*http.Response, error) { + var err error + const operationName = "ReplicationProtectionClustersClient.BeginTestFailoverCleanup" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.testFailoverCleanupCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, cleanupInput, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// testFailoverCleanupCreateRequest creates the TestFailoverCleanup request. +func (client *ReplicationProtectionClustersClient) testFailoverCleanupCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, cleanupInput ClusterTestFailoverCleanupInput, options *ReplicationProtectionClustersClientBeginTestFailoverCleanupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/testFailoverCleanup" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if fabricName == "" { + return nil, errors.New("parameter fabricName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{fabricName}", url.PathEscape(fabricName)) + if protectionContainerName == "" { + return nil, errors.New("parameter protectionContainerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{protectionContainerName}", url.PathEscape(protectionContainerName)) + if replicationProtectionClusterName == "" { + return nil, errors.New("parameter replicationProtectionClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{replicationProtectionClusterName}", url.PathEscape(replicationProtectionClusterName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, cleanupInput); err != nil { + return nil, err + } + return req, nil +} + +// BeginUnplannedFailover - Operation to initiate a failover of the replication protection cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-01-01 +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. +// - fabricName - Fabric name. +// - protectionContainerName - Protection container name. +// - replicationProtectionClusterName - Replication protection cluster name. +// - failoverInput - Failover input. +// - options - ReplicationProtectionClustersClientBeginUnplannedFailoverOptions contains the optional parameters for the ReplicationProtectionClustersClient.BeginUnplannedFailover +// method. +func (client *ReplicationProtectionClustersClient) BeginUnplannedFailover(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, failoverInput ClusterUnplannedFailoverInput, options *ReplicationProtectionClustersClientBeginUnplannedFailoverOptions) (*runtime.Poller[ReplicationProtectionClustersClientUnplannedFailoverResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.unplannedFailover(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, failoverInput, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReplicationProtectionClustersClientUnplannedFailoverResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ReplicationProtectionClustersClientUnplannedFailoverResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// UnplannedFailover - Operation to initiate a failover of the replication protection cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-01-01 +func (client *ReplicationProtectionClustersClient) unplannedFailover(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, failoverInput ClusterUnplannedFailoverInput, options *ReplicationProtectionClustersClientBeginUnplannedFailoverOptions) (*http.Response, error) { + var err error + const operationName = "ReplicationProtectionClustersClient.BeginUnplannedFailover" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.unplannedFailoverCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, failoverInput, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// unplannedFailoverCreateRequest creates the UnplannedFailover request. +func (client *ReplicationProtectionClustersClient) unplannedFailoverCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicationProtectionClusterName string, failoverInput ClusterUnplannedFailoverInput, options *ReplicationProtectionClustersClientBeginUnplannedFailoverOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/unplannedFailover" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if fabricName == "" { + return nil, errors.New("parameter fabricName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{fabricName}", url.PathEscape(fabricName)) + if protectionContainerName == "" { + return nil, errors.New("parameter protectionContainerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{protectionContainerName}", url.PathEscape(protectionContainerName)) + if replicationProtectionClusterName == "" { + return nil, errors.New("parameter replicationProtectionClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{replicationProtectionClusterName}", url.PathEscape(replicationProtectionClusterName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, failoverInput); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectioncontainermappings_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectioncontainermappings_client.go index 3b074d1cfbf4..f9a682077421 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectioncontainermappings_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectioncontainermappings_client.go @@ -46,18 +46,18 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - protectionContainerName - Protection container name. // - mappingName - Protection container mapping name. // - creationInput - Mapping creation input. // - options - ReplicationProtectionContainerMappingsClientBeginCreateOptions contains the optional parameters for the ReplicationProtectionContainerMappingsClient.BeginCreate // method. -func (client *ReplicationProtectionContainerMappingsClient) BeginCreate(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, mappingName string, creationInput CreateProtectionContainerMappingInput, options *ReplicationProtectionContainerMappingsClientBeginCreateOptions) (*runtime.Poller[ReplicationProtectionContainerMappingsClientCreateResponse], error) { +func (client *ReplicationProtectionContainerMappingsClient) BeginCreate(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, mappingName string, creationInput CreateProtectionContainerMappingInput, options *ReplicationProtectionContainerMappingsClientBeginCreateOptions) (*runtime.Poller[ReplicationProtectionContainerMappingsClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, creationInput, options) + resp, err := client.create(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, mappingName, creationInput, options) if err != nil { return nil, err } @@ -75,14 +75,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectionContainerMappingsClient) create(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, mappingName string, creationInput CreateProtectionContainerMappingInput, options *ReplicationProtectionContainerMappingsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectionContainerMappingsClient.BeginCreate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, creationInput, options) + req, err := client.createCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, mappingName, creationInput, options) if err != nil { return nil, err } @@ -98,16 +98,16 @@ func (client *ReplicationProtectionContainerMappingsClient) create(ctx context.C } // createCreateRequest creates the Create request. -func (client *ReplicationProtectionContainerMappingsClient) createCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, mappingName string, creationInput CreateProtectionContainerMappingInput, options *ReplicationProtectionContainerMappingsClientBeginCreateOptions) (*policy.Request, error) { +func (client *ReplicationProtectionContainerMappingsClient) createCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, mappingName string, creationInput CreateProtectionContainerMappingInput, options *ReplicationProtectionContainerMappingsClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -129,7 +129,7 @@ func (client *ReplicationProtectionContainerMappingsClient) createCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, creationInput); err != nil { @@ -141,18 +141,18 @@ func (client *ReplicationProtectionContainerMappingsClient) createCreateRequest( // 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - protectionContainerName - Protection container name. // - mappingName - Protection container mapping name. // - removalInput - Removal input. // - options - ReplicationProtectionContainerMappingsClientBeginDeleteOptions contains the optional parameters for the ReplicationProtectionContainerMappingsClient.BeginDelete // method. -func (client *ReplicationProtectionContainerMappingsClient) BeginDelete(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, mappingName string, removalInput RemoveProtectionContainerMappingInput, options *ReplicationProtectionContainerMappingsClientBeginDeleteOptions) (*runtime.Poller[ReplicationProtectionContainerMappingsClientDeleteResponse], error) { +func (client *ReplicationProtectionContainerMappingsClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, mappingName string, removalInput RemoveProtectionContainerMappingInput, options *ReplicationProtectionContainerMappingsClientBeginDeleteOptions) (*runtime.Poller[ReplicationProtectionContainerMappingsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, removalInput, options) + resp, err := client.deleteOperation(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, mappingName, removalInput, options) if err != nil { return nil, err } @@ -170,14 +170,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectionContainerMappingsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, mappingName string, removalInput RemoveProtectionContainerMappingInput, options *ReplicationProtectionContainerMappingsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectionContainerMappingsClient.BeginDelete" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, removalInput, options) + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, mappingName, removalInput, options) if err != nil { return nil, err } @@ -193,16 +193,16 @@ func (client *ReplicationProtectionContainerMappingsClient) deleteOperation(ctx } // deleteCreateRequest creates the Delete request. -func (client *ReplicationProtectionContainerMappingsClient) deleteCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, mappingName string, removalInput RemoveProtectionContainerMappingInput, options *ReplicationProtectionContainerMappingsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ReplicationProtectionContainerMappingsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, mappingName string, removalInput RemoveProtectionContainerMappingInput, options *ReplicationProtectionContainerMappingsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}/remove" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -224,7 +224,7 @@ func (client *ReplicationProtectionContainerMappingsClient) deleteCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() if err := runtime.MarshalAsJSON(req, removalInput); err != nil { return nil, err @@ -235,21 +235,21 @@ func (client *ReplicationProtectionContainerMappingsClient) deleteCreateRequest( // Get - Gets the details of a protection container mapping. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - protectionContainerName - Protection container name. // - mappingName - Protection Container mapping name. // - 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) { +func (client *ReplicationProtectionContainerMappingsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, mappingName string, options *ReplicationProtectionContainerMappingsClientGetOptions) (ReplicationProtectionContainerMappingsClientGetResponse, error) { var err error const operationName = "ReplicationProtectionContainerMappingsClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, mappingName, options) if err != nil { return ReplicationProtectionContainerMappingsClientGetResponse{}, err } @@ -266,16 +266,16 @@ func (client *ReplicationProtectionContainerMappingsClient) Get(ctx context.Cont } // getCreateRequest creates the Get request. -func (client *ReplicationProtectionContainerMappingsClient) getCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, mappingName string, options *ReplicationProtectionContainerMappingsClientGetOptions) (*policy.Request, error) { +func (client *ReplicationProtectionContainerMappingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, mappingName string, options *ReplicationProtectionContainerMappingsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -297,7 +297,7 @@ func (client *ReplicationProtectionContainerMappingsClient) getCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -314,12 +314,12 @@ func (client *ReplicationProtectionContainerMappingsClient) getHandleResponse(re // NewListPager - Lists the protection container mappings in the vault. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - options - ReplicationProtectionContainerMappingsClientListOptions contains the optional parameters for the ReplicationProtectionContainerMappingsClient.NewListPager // method. -func (client *ReplicationProtectionContainerMappingsClient) NewListPager(resourceName string, resourceGroupName string, options *ReplicationProtectionContainerMappingsClientListOptions) *runtime.Pager[ReplicationProtectionContainerMappingsClientListResponse] { +func (client *ReplicationProtectionContainerMappingsClient) NewListPager(resourceGroupName string, resourceName string, options *ReplicationProtectionContainerMappingsClientListOptions) *runtime.Pager[ReplicationProtectionContainerMappingsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationProtectionContainerMappingsClientListResponse]{ More: func(page ReplicationProtectionContainerMappingsClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -331,7 +331,7 @@ func (client *ReplicationProtectionContainerMappingsClient) NewListPager(resourc nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceName, resourceGroupName, options) + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) }, nil) if err != nil { return ReplicationProtectionContainerMappingsClientListResponse{}, err @@ -343,16 +343,16 @@ func (client *ReplicationProtectionContainerMappingsClient) NewListPager(resourc } // listCreateRequest creates the List request. -func (client *ReplicationProtectionContainerMappingsClient) listCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, options *ReplicationProtectionContainerMappingsClientListOptions) (*policy.Request, error) { +func (client *ReplicationProtectionContainerMappingsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicationProtectionContainerMappingsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionContainerMappings" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -362,7 +362,7 @@ func (client *ReplicationProtectionContainerMappingsClient) listCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -379,14 +379,14 @@ func (client *ReplicationProtectionContainerMappingsClient) listHandleResponse(r // NewListByReplicationProtectionContainersPager - Lists the protection container mappings for a protection container. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - protectionContainerName - Protection container name. // - options - ReplicationProtectionContainerMappingsClientListByReplicationProtectionContainersOptions contains the optional // parameters for the ReplicationProtectionContainerMappingsClient.NewListByReplicationProtectionContainersPager method. -func (client *ReplicationProtectionContainerMappingsClient) NewListByReplicationProtectionContainersPager(resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, options *ReplicationProtectionContainerMappingsClientListByReplicationProtectionContainersOptions) *runtime.Pager[ReplicationProtectionContainerMappingsClientListByReplicationProtectionContainersResponse] { +func (client *ReplicationProtectionContainerMappingsClient) NewListByReplicationProtectionContainersPager(resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, options *ReplicationProtectionContainerMappingsClientListByReplicationProtectionContainersOptions) *runtime.Pager[ReplicationProtectionContainerMappingsClientListByReplicationProtectionContainersResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationProtectionContainerMappingsClientListByReplicationProtectionContainersResponse]{ More: func(page ReplicationProtectionContainerMappingsClientListByReplicationProtectionContainersResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -398,7 +398,7 @@ func (client *ReplicationProtectionContainerMappingsClient) NewListByReplication nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByReplicationProtectionContainersCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, options) + return client.listByReplicationProtectionContainersCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, options) }, nil) if err != nil { return ReplicationProtectionContainerMappingsClientListByReplicationProtectionContainersResponse{}, err @@ -410,16 +410,16 @@ func (client *ReplicationProtectionContainerMappingsClient) NewListByReplication } // listByReplicationProtectionContainersCreateRequest creates the ListByReplicationProtectionContainers request. -func (client *ReplicationProtectionContainerMappingsClient) listByReplicationProtectionContainersCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, options *ReplicationProtectionContainerMappingsClientListByReplicationProtectionContainersOptions) (*policy.Request, error) { +func (client *ReplicationProtectionContainerMappingsClient) listByReplicationProtectionContainersCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, options *ReplicationProtectionContainerMappingsClientListByReplicationProtectionContainersOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -437,7 +437,7 @@ func (client *ReplicationProtectionContainerMappingsClient) listByReplicationPro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -455,17 +455,17 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - protectionContainerName - Protection container name. // - mappingName - Protection container mapping name. // - options - ReplicationProtectionContainerMappingsClientBeginPurgeOptions contains the optional parameters for the ReplicationProtectionContainerMappingsClient.BeginPurge // method. -func (client *ReplicationProtectionContainerMappingsClient) BeginPurge(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, mappingName string, options *ReplicationProtectionContainerMappingsClientBeginPurgeOptions) (*runtime.Poller[ReplicationProtectionContainerMappingsClientPurgeResponse], error) { +func (client *ReplicationProtectionContainerMappingsClient) BeginPurge(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, mappingName string, options *ReplicationProtectionContainerMappingsClientBeginPurgeOptions) (*runtime.Poller[ReplicationProtectionContainerMappingsClientPurgeResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.purge(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, options) + resp, err := client.purge(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, mappingName, options) if err != nil { return nil, err } @@ -483,14 +483,14 @@ 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 2023-08-01 -func (client *ReplicationProtectionContainerMappingsClient) purge(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, mappingName string, options *ReplicationProtectionContainerMappingsClientBeginPurgeOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectionContainerMappingsClient) purge(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, mappingName string, options *ReplicationProtectionContainerMappingsClientBeginPurgeOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectionContainerMappingsClient.BeginPurge" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.purgeCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, options) + req, err := client.purgeCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, mappingName, options) if err != nil { return nil, err } @@ -506,16 +506,16 @@ func (client *ReplicationProtectionContainerMappingsClient) purge(ctx context.Co } // purgeCreateRequest creates the Purge request. -func (client *ReplicationProtectionContainerMappingsClient) purgeCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, mappingName string, options *ReplicationProtectionContainerMappingsClientBeginPurgeOptions) (*policy.Request, error) { +func (client *ReplicationProtectionContainerMappingsClient) purgeCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, mappingName string, options *ReplicationProtectionContainerMappingsClientBeginPurgeOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -537,7 +537,7 @@ func (client *ReplicationProtectionContainerMappingsClient) purgeCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -545,18 +545,18 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - protectionContainerName - Protection container name. // - mappingName - Protection container mapping name. // - updateInput - Mapping update input. // - options - ReplicationProtectionContainerMappingsClientBeginUpdateOptions contains the optional parameters for the ReplicationProtectionContainerMappingsClient.BeginUpdate // method. -func (client *ReplicationProtectionContainerMappingsClient) BeginUpdate(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, mappingName string, updateInput UpdateProtectionContainerMappingInput, options *ReplicationProtectionContainerMappingsClientBeginUpdateOptions) (*runtime.Poller[ReplicationProtectionContainerMappingsClientUpdateResponse], error) { +func (client *ReplicationProtectionContainerMappingsClient) BeginUpdate(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, mappingName string, updateInput UpdateProtectionContainerMappingInput, options *ReplicationProtectionContainerMappingsClientBeginUpdateOptions) (*runtime.Poller[ReplicationProtectionContainerMappingsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, updateInput, options) + resp, err := client.update(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, mappingName, updateInput, options) if err != nil { return nil, err } @@ -574,14 +574,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectionContainerMappingsClient) update(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, mappingName string, updateInput UpdateProtectionContainerMappingInput, options *ReplicationProtectionContainerMappingsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectionContainerMappingsClient.BeginUpdate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, mappingName, updateInput, options) + req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, mappingName, updateInput, options) if err != nil { return nil, err } @@ -597,16 +597,16 @@ func (client *ReplicationProtectionContainerMappingsClient) update(ctx context.C } // updateCreateRequest creates the Update request. -func (client *ReplicationProtectionContainerMappingsClient) updateCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, mappingName string, updateInput UpdateProtectionContainerMappingInput, options *ReplicationProtectionContainerMappingsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *ReplicationProtectionContainerMappingsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, mappingName string, updateInput UpdateProtectionContainerMappingInput, options *ReplicationProtectionContainerMappingsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -628,7 +628,7 @@ func (client *ReplicationProtectionContainerMappingsClient) updateCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, updateInput); err != 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 b4ecda9ed86b..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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 75959f64f435..1ec3b26ddf51 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectioncontainers_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectioncontainers_client.go @@ -46,17 +46,17 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Unique fabric ARM name. // - protectionContainerName - Unique protection container ARM name. // - creationInput - Creation input. // - options - ReplicationProtectionContainersClientBeginCreateOptions contains the optional parameters for the ReplicationProtectionContainersClient.BeginCreate // method. -func (client *ReplicationProtectionContainersClient) BeginCreate(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, creationInput CreateProtectionContainerInput, options *ReplicationProtectionContainersClientBeginCreateOptions) (*runtime.Poller[ReplicationProtectionContainersClientCreateResponse], error) { +func (client *ReplicationProtectionContainersClient) BeginCreate(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, creationInput CreateProtectionContainerInput, options *ReplicationProtectionContainersClientBeginCreateOptions) (*runtime.Poller[ReplicationProtectionContainersClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, creationInput, options) + resp, err := client.create(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, creationInput, options) if err != nil { return nil, err } @@ -74,14 +74,14 @@ 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 2023-08-01 -func (client *ReplicationProtectionContainersClient) create(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, creationInput CreateProtectionContainerInput, options *ReplicationProtectionContainersClientBeginCreateOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectionContainersClient) create(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, creationInput CreateProtectionContainerInput, options *ReplicationProtectionContainersClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectionContainersClient.BeginCreate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, creationInput, options) + req, err := client.createCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, creationInput, options) if err != nil { return nil, err } @@ -97,16 +97,16 @@ func (client *ReplicationProtectionContainersClient) create(ctx context.Context, } // createCreateRequest creates the Create request. -func (client *ReplicationProtectionContainersClient) createCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, creationInput CreateProtectionContainerInput, options *ReplicationProtectionContainersClientBeginCreateOptions) (*policy.Request, error) { +func (client *ReplicationProtectionContainersClient) createCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, creationInput CreateProtectionContainerInput, options *ReplicationProtectionContainersClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -124,7 +124,7 @@ func (client *ReplicationProtectionContainersClient) createCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, creationInput); err != nil { @@ -136,16 +136,16 @@ func (client *ReplicationProtectionContainersClient) createCreateRequest(ctx con // BeginDelete - Operation to remove a protection container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Unique fabric ARM name. // - protectionContainerName - Unique protection container ARM name. // - options - ReplicationProtectionContainersClientBeginDeleteOptions contains the optional parameters for the ReplicationProtectionContainersClient.BeginDelete // method. -func (client *ReplicationProtectionContainersClient) BeginDelete(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, options *ReplicationProtectionContainersClientBeginDeleteOptions) (*runtime.Poller[ReplicationProtectionContainersClientDeleteResponse], error) { +func (client *ReplicationProtectionContainersClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, options *ReplicationProtectionContainersClientBeginDeleteOptions) (*runtime.Poller[ReplicationProtectionContainersClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, options) + resp, err := client.deleteOperation(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, options) if err != nil { return nil, err } @@ -163,14 +163,14 @@ 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 2023-08-01 -func (client *ReplicationProtectionContainersClient) deleteOperation(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, options *ReplicationProtectionContainersClientBeginDeleteOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectionContainersClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, options *ReplicationProtectionContainersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectionContainersClient.BeginDelete" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, options) + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, options) if err != nil { return nil, err } @@ -186,16 +186,16 @@ func (client *ReplicationProtectionContainersClient) deleteOperation(ctx context } // deleteCreateRequest creates the Delete request. -func (client *ReplicationProtectionContainersClient) deleteCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, options *ReplicationProtectionContainersClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ReplicationProtectionContainersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, options *ReplicationProtectionContainersClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/remove" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -213,7 +213,7 @@ func (client *ReplicationProtectionContainersClient) deleteCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -221,17 +221,17 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - The name of the fabric. // - protectionContainerName - The name of the protection container. // - discoverProtectableItemRequest - The request object to add a protectable item. // - options - ReplicationProtectionContainersClientBeginDiscoverProtectableItemOptions contains the optional parameters for // the ReplicationProtectionContainersClient.BeginDiscoverProtectableItem method. -func (client *ReplicationProtectionContainersClient) BeginDiscoverProtectableItem(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, discoverProtectableItemRequest DiscoverProtectableItemRequest, options *ReplicationProtectionContainersClientBeginDiscoverProtectableItemOptions) (*runtime.Poller[ReplicationProtectionContainersClientDiscoverProtectableItemResponse], error) { +func (client *ReplicationProtectionContainersClient) BeginDiscoverProtectableItem(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, discoverProtectableItemRequest DiscoverProtectableItemRequest, options *ReplicationProtectionContainersClientBeginDiscoverProtectableItemOptions) (*runtime.Poller[ReplicationProtectionContainersClientDiscoverProtectableItemResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.discoverProtectableItem(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, discoverProtectableItemRequest, options) + resp, err := client.discoverProtectableItem(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, discoverProtectableItemRequest, options) if err != nil { return nil, err } @@ -249,14 +249,14 @@ 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 2023-08-01 -func (client *ReplicationProtectionContainersClient) discoverProtectableItem(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, discoverProtectableItemRequest DiscoverProtectableItemRequest, options *ReplicationProtectionContainersClientBeginDiscoverProtectableItemOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectionContainersClient) discoverProtectableItem(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, discoverProtectableItemRequest DiscoverProtectableItemRequest, options *ReplicationProtectionContainersClientBeginDiscoverProtectableItemOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectionContainersClient.BeginDiscoverProtectableItem" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.discoverProtectableItemCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, discoverProtectableItemRequest, options) + req, err := client.discoverProtectableItemCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, discoverProtectableItemRequest, options) if err != nil { return nil, err } @@ -272,16 +272,16 @@ func (client *ReplicationProtectionContainersClient) discoverProtectableItem(ctx } // discoverProtectableItemCreateRequest creates the DiscoverProtectableItem request. -func (client *ReplicationProtectionContainersClient) discoverProtectableItemCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, discoverProtectableItemRequest DiscoverProtectableItemRequest, options *ReplicationProtectionContainersClientBeginDiscoverProtectableItemOptions) (*policy.Request, error) { +func (client *ReplicationProtectionContainersClient) discoverProtectableItemCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, discoverProtectableItemRequest DiscoverProtectableItemRequest, options *ReplicationProtectionContainersClientBeginDiscoverProtectableItemOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/discoverProtectableItem" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -299,7 +299,7 @@ func (client *ReplicationProtectionContainersClient) discoverProtectableItemCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, discoverProtectableItemRequest); err != nil { @@ -311,20 +311,20 @@ func (client *ReplicationProtectionContainersClient) discoverProtectableItemCrea // Get - Gets the details of a protection container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - protectionContainerName - Protection container name. // - 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) { +func (client *ReplicationProtectionContainersClient) Get(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, options *ReplicationProtectionContainersClientGetOptions) (ReplicationProtectionContainersClientGetResponse, error) { var err error const operationName = "ReplicationProtectionContainersClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, options) if err != nil { return ReplicationProtectionContainersClientGetResponse{}, err } @@ -341,16 +341,16 @@ func (client *ReplicationProtectionContainersClient) Get(ctx context.Context, re } // getCreateRequest creates the Get request. -func (client *ReplicationProtectionContainersClient) getCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, options *ReplicationProtectionContainersClientGetOptions) (*policy.Request, error) { +func (client *ReplicationProtectionContainersClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, options *ReplicationProtectionContainersClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -368,7 +368,7 @@ func (client *ReplicationProtectionContainersClient) getCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -385,12 +385,12 @@ func (client *ReplicationProtectionContainersClient) getHandleResponse(resp *htt // NewListPager - Lists the protection containers in a vault. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - options - ReplicationProtectionContainersClientListOptions contains the optional parameters for the ReplicationProtectionContainersClient.NewListPager // method. -func (client *ReplicationProtectionContainersClient) NewListPager(resourceName string, resourceGroupName string, options *ReplicationProtectionContainersClientListOptions) *runtime.Pager[ReplicationProtectionContainersClientListResponse] { +func (client *ReplicationProtectionContainersClient) NewListPager(resourceGroupName string, resourceName string, options *ReplicationProtectionContainersClientListOptions) *runtime.Pager[ReplicationProtectionContainersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationProtectionContainersClientListResponse]{ More: func(page ReplicationProtectionContainersClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -402,7 +402,7 @@ func (client *ReplicationProtectionContainersClient) NewListPager(resourceName s nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceName, resourceGroupName, options) + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) }, nil) if err != nil { return ReplicationProtectionContainersClientListResponse{}, err @@ -414,16 +414,16 @@ func (client *ReplicationProtectionContainersClient) NewListPager(resourceName s } // listCreateRequest creates the List request. -func (client *ReplicationProtectionContainersClient) listCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, options *ReplicationProtectionContainersClientListOptions) (*policy.Request, error) { +func (client *ReplicationProtectionContainersClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicationProtectionContainersClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionContainers" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -433,7 +433,7 @@ func (client *ReplicationProtectionContainersClient) listCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -450,13 +450,13 @@ func (client *ReplicationProtectionContainersClient) listHandleResponse(resp *ht // NewListByReplicationFabricsPager - Lists the protection containers in the specified fabric. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - options - ReplicationProtectionContainersClientListByReplicationFabricsOptions contains the optional parameters for the // ReplicationProtectionContainersClient.NewListByReplicationFabricsPager method. -func (client *ReplicationProtectionContainersClient) NewListByReplicationFabricsPager(resourceName string, resourceGroupName string, fabricName string, options *ReplicationProtectionContainersClientListByReplicationFabricsOptions) *runtime.Pager[ReplicationProtectionContainersClientListByReplicationFabricsResponse] { +func (client *ReplicationProtectionContainersClient) NewListByReplicationFabricsPager(resourceGroupName string, resourceName string, fabricName string, options *ReplicationProtectionContainersClientListByReplicationFabricsOptions) *runtime.Pager[ReplicationProtectionContainersClientListByReplicationFabricsResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationProtectionContainersClientListByReplicationFabricsResponse]{ More: func(page ReplicationProtectionContainersClientListByReplicationFabricsResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -468,7 +468,7 @@ func (client *ReplicationProtectionContainersClient) NewListByReplicationFabrics nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByReplicationFabricsCreateRequest(ctx, resourceName, resourceGroupName, fabricName, options) + return client.listByReplicationFabricsCreateRequest(ctx, resourceGroupName, resourceName, fabricName, options) }, nil) if err != nil { return ReplicationProtectionContainersClientListByReplicationFabricsResponse{}, err @@ -480,16 +480,16 @@ func (client *ReplicationProtectionContainersClient) NewListByReplicationFabrics } // listByReplicationFabricsCreateRequest creates the ListByReplicationFabrics request. -func (client *ReplicationProtectionContainersClient) listByReplicationFabricsCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *ReplicationProtectionContainersClientListByReplicationFabricsOptions) (*policy.Request, error) { +func (client *ReplicationProtectionContainersClient) listByReplicationFabricsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *ReplicationProtectionContainersClientListByReplicationFabricsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -503,7 +503,7 @@ func (client *ReplicationProtectionContainersClient) listByReplicationFabricsCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -518,20 +518,111 @@ func (client *ReplicationProtectionContainersClient) listByReplicationFabricsHan return result, nil } -// BeginSwitchProtection - Operation to switch protection from one container to another or one replication provider to another. +// BeginSwitchClusterProtection - Operation to switch protection from one container to another. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 +// Generated from API version 2025-01-01 +// - resourceGroupName - The name of the resource group where the recovery services vault is present. // - resourceName - The name of the recovery services vault. +// - fabricName - Fabric name. +// - protectionContainerName - Protection container name. +// - switchInput - Switch protection input. +// - options - ReplicationProtectionContainersClientBeginSwitchClusterProtectionOptions contains the optional parameters for +// the ReplicationProtectionContainersClient.BeginSwitchClusterProtection method. +func (client *ReplicationProtectionContainersClient) BeginSwitchClusterProtection(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, switchInput SwitchClusterProtectionInput, options *ReplicationProtectionContainersClientBeginSwitchClusterProtectionOptions) (*runtime.Poller[ReplicationProtectionContainersClientSwitchClusterProtectionResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.switchClusterProtection(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, switchInput, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReplicationProtectionContainersClientSwitchClusterProtectionResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ReplicationProtectionContainersClientSwitchClusterProtectionResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// SwitchClusterProtection - Operation to switch protection from one container to another. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-01-01 +func (client *ReplicationProtectionContainersClient) switchClusterProtection(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, switchInput SwitchClusterProtectionInput, options *ReplicationProtectionContainersClientBeginSwitchClusterProtectionOptions) (*http.Response, error) { + var err error + const operationName = "ReplicationProtectionContainersClient.BeginSwitchClusterProtection" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.switchClusterProtectionCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, switchInput, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// switchClusterProtectionCreateRequest creates the SwitchClusterProtection request. +func (client *ReplicationProtectionContainersClient) switchClusterProtectionCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, switchInput SwitchClusterProtectionInput, options *ReplicationProtectionContainersClientBeginSwitchClusterProtectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/switchClusterProtection" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if fabricName == "" { + return nil, errors.New("parameter fabricName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{fabricName}", url.PathEscape(fabricName)) + if protectionContainerName == "" { + return nil, errors.New("parameter protectionContainerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{protectionContainerName}", url.PathEscape(protectionContainerName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, switchInput); err != nil { + return nil, err + } + return req, nil +} + +// 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 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Unique fabric name. // - protectionContainerName - Protection container name. // - switchInput - Switch protection input. // - options - ReplicationProtectionContainersClientBeginSwitchProtectionOptions contains the optional parameters for the ReplicationProtectionContainersClient.BeginSwitchProtection // method. -func (client *ReplicationProtectionContainersClient) BeginSwitchProtection(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, switchInput SwitchProtectionInput, options *ReplicationProtectionContainersClientBeginSwitchProtectionOptions) (*runtime.Poller[ReplicationProtectionContainersClientSwitchProtectionResponse], error) { +func (client *ReplicationProtectionContainersClient) BeginSwitchProtection(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, switchInput SwitchProtectionInput, options *ReplicationProtectionContainersClientBeginSwitchProtectionOptions) (*runtime.Poller[ReplicationProtectionContainersClientSwitchProtectionResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.switchProtection(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, switchInput, options) + resp, err := client.switchProtection(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, switchInput, options) if err != nil { return nil, err } @@ -549,14 +640,14 @@ 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 2023-08-01 -func (client *ReplicationProtectionContainersClient) switchProtection(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, switchInput SwitchProtectionInput, options *ReplicationProtectionContainersClientBeginSwitchProtectionOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationProtectionContainersClient) switchProtection(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, switchInput SwitchProtectionInput, options *ReplicationProtectionContainersClientBeginSwitchProtectionOptions) (*http.Response, error) { var err error const operationName = "ReplicationProtectionContainersClient.BeginSwitchProtection" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.switchProtectionCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, switchInput, options) + req, err := client.switchProtectionCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, switchInput, options) if err != nil { return nil, err } @@ -572,16 +663,16 @@ func (client *ReplicationProtectionContainersClient) switchProtection(ctx contex } // switchProtectionCreateRequest creates the SwitchProtection request. -func (client *ReplicationProtectionContainersClient) switchProtectionCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, switchInput SwitchProtectionInput, options *ReplicationProtectionContainersClientBeginSwitchProtectionOptions) (*policy.Request, error) { +func (client *ReplicationProtectionContainersClient) switchProtectionCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, switchInput SwitchProtectionInput, options *ReplicationProtectionContainersClientBeginSwitchProtectionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/switchprotection" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -599,7 +690,7 @@ func (client *ReplicationProtectionContainersClient) switchProtectionCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, switchInput); err != 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 9e25be13d9f5..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectioncontainers_client_example_test.go +++ /dev/null @@ -1,286 +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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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"), - }, - ReplicationProtectedItemName: to.Ptr("a2aSwapOsVm"), - }, - }, 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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 c49685504faf..8e95ae3a11f0 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectionintents_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationprotectionintents_client.go @@ -46,20 +46,20 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - intentObjectName - A name for the replication protection item. // - input - Create Protection Intent Input. // - 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) { +func (client *ReplicationProtectionIntentsClient) Create(ctx context.Context, resourceGroupName string, resourceName string, intentObjectName string, input CreateProtectionIntentInput, options *ReplicationProtectionIntentsClientCreateOptions) (ReplicationProtectionIntentsClientCreateResponse, error) { var err error const operationName = "ReplicationProtectionIntentsClient.Create" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, intentObjectName, input, options) + req, err := client.createCreateRequest(ctx, resourceGroupName, resourceName, intentObjectName, input, options) if err != nil { return ReplicationProtectionIntentsClientCreateResponse{}, err } @@ -76,16 +76,16 @@ func (client *ReplicationProtectionIntentsClient) Create(ctx context.Context, re } // createCreateRequest creates the Create request. -func (client *ReplicationProtectionIntentsClient) createCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, intentObjectName string, input CreateProtectionIntentInput, options *ReplicationProtectionIntentsClientCreateOptions) (*policy.Request, error) { +func (client *ReplicationProtectionIntentsClient) createCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, intentObjectName string, input CreateProtectionIntentInput, options *ReplicationProtectionIntentsClientCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -99,7 +99,7 @@ func (client *ReplicationProtectionIntentsClient) createCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, input); err != nil { @@ -120,19 +120,19 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - 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) { +func (client *ReplicationProtectionIntentsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, intentObjectName string, options *ReplicationProtectionIntentsClientGetOptions) (ReplicationProtectionIntentsClientGetResponse, error) { var err error const operationName = "ReplicationProtectionIntentsClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, intentObjectName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, intentObjectName, options) if err != nil { return ReplicationProtectionIntentsClientGetResponse{}, err } @@ -149,16 +149,16 @@ func (client *ReplicationProtectionIntentsClient) Get(ctx context.Context, resou } // getCreateRequest creates the Get request. -func (client *ReplicationProtectionIntentsClient) getCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, intentObjectName string, options *ReplicationProtectionIntentsClientGetOptions) (*policy.Request, error) { +func (client *ReplicationProtectionIntentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, intentObjectName string, options *ReplicationProtectionIntentsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -172,7 +172,7 @@ func (client *ReplicationProtectionIntentsClient) getCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -189,12 +189,12 @@ func (client *ReplicationProtectionIntentsClient) getHandleResponse(resp *http.R // NewListPager - Gets the list of ASR replication protection intent objects in the vault. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - options - ReplicationProtectionIntentsClientListOptions contains the optional parameters for the ReplicationProtectionIntentsClient.NewListPager // method. -func (client *ReplicationProtectionIntentsClient) NewListPager(resourceName string, resourceGroupName string, options *ReplicationProtectionIntentsClientListOptions) *runtime.Pager[ReplicationProtectionIntentsClientListResponse] { +func (client *ReplicationProtectionIntentsClient) NewListPager(resourceGroupName string, resourceName string, options *ReplicationProtectionIntentsClientListOptions) *runtime.Pager[ReplicationProtectionIntentsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationProtectionIntentsClientListResponse]{ More: func(page ReplicationProtectionIntentsClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -206,7 +206,7 @@ func (client *ReplicationProtectionIntentsClient) NewListPager(resourceName stri nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceName, resourceGroupName, options) + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) }, nil) if err != nil { return ReplicationProtectionIntentsClientListResponse{}, err @@ -218,16 +218,16 @@ func (client *ReplicationProtectionIntentsClient) NewListPager(resourceName stri } // listCreateRequest creates the List request. -func (client *ReplicationProtectionIntentsClient) listCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, options *ReplicationProtectionIntentsClientListOptions) (*policy.Request, error) { +func (client *ReplicationProtectionIntentsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicationProtectionIntentsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -237,7 +237,7 @@ func (client *ReplicationProtectionIntentsClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-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 2ef4f60c658d..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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 5416568e9f17..012476f8ab84 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationrecoveryplans_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationrecoveryplans_client.go @@ -46,16 +46,16 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - recoveryPlanName - Recovery plan name. // - input - Recovery Plan creation input. // - options - ReplicationRecoveryPlansClientBeginCreateOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginCreate // method. -func (client *ReplicationRecoveryPlansClient) BeginCreate(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input CreateRecoveryPlanInput, options *ReplicationRecoveryPlansClientBeginCreateOptions) (*runtime.Poller[ReplicationRecoveryPlansClientCreateResponse], error) { +func (client *ReplicationRecoveryPlansClient) BeginCreate(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, input CreateRecoveryPlanInput, options *ReplicationRecoveryPlansClientBeginCreateOptions) (*runtime.Poller[ReplicationRecoveryPlansClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceName, resourceGroupName, recoveryPlanName, input, options) + resp, err := client.create(ctx, resourceGroupName, resourceName, recoveryPlanName, input, options) if err != nil { return nil, err } @@ -73,14 +73,14 @@ 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 2023-08-01 -func (client *ReplicationRecoveryPlansClient) create(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input CreateRecoveryPlanInput, options *ReplicationRecoveryPlansClientBeginCreateOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationRecoveryPlansClient) create(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, input CreateRecoveryPlanInput, options *ReplicationRecoveryPlansClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "ReplicationRecoveryPlansClient.BeginCreate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, recoveryPlanName, input, options) + req, err := client.createCreateRequest(ctx, resourceGroupName, resourceName, recoveryPlanName, input, options) if err != nil { return nil, err } @@ -96,16 +96,16 @@ func (client *ReplicationRecoveryPlansClient) create(ctx context.Context, resour } // createCreateRequest creates the Create request. -func (client *ReplicationRecoveryPlansClient) createCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input CreateRecoveryPlanInput, options *ReplicationRecoveryPlansClientBeginCreateOptions) (*policy.Request, error) { +func (client *ReplicationRecoveryPlansClient) createCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, input CreateRecoveryPlanInput, options *ReplicationRecoveryPlansClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -119,7 +119,7 @@ func (client *ReplicationRecoveryPlansClient) createCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, input); err != nil { @@ -131,15 +131,15 @@ func (client *ReplicationRecoveryPlansClient) createCreateRequest(ctx context.Co // BeginDelete - Delete a recovery plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - recoveryPlanName - Recovery plan name. // - options - ReplicationRecoveryPlansClientBeginDeleteOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginDelete // method. -func (client *ReplicationRecoveryPlansClient) BeginDelete(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginDeleteOptions) (*runtime.Poller[ReplicationRecoveryPlansClientDeleteResponse], error) { +func (client *ReplicationRecoveryPlansClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginDeleteOptions) (*runtime.Poller[ReplicationRecoveryPlansClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceName, resourceGroupName, recoveryPlanName, options) + resp, err := client.deleteOperation(ctx, resourceGroupName, resourceName, recoveryPlanName, options) if err != nil { return nil, err } @@ -157,14 +157,14 @@ 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 2023-08-01 -func (client *ReplicationRecoveryPlansClient) deleteOperation(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginDeleteOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationRecoveryPlansClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ReplicationRecoveryPlansClient.BeginDelete" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceName, resourceGroupName, recoveryPlanName, options) + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, recoveryPlanName, options) if err != nil { return nil, err } @@ -180,16 +180,16 @@ func (client *ReplicationRecoveryPlansClient) deleteOperation(ctx context.Contex } // deleteCreateRequest creates the Delete request. -func (client *ReplicationRecoveryPlansClient) deleteCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ReplicationRecoveryPlansClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -203,7 +203,7 @@ func (client *ReplicationRecoveryPlansClient) deleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -211,15 +211,15 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - recoveryPlanName - Recovery plan name. // - options - ReplicationRecoveryPlansClientBeginFailoverCancelOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginFailoverCancel // method. -func (client *ReplicationRecoveryPlansClient) BeginFailoverCancel(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginFailoverCancelOptions) (*runtime.Poller[ReplicationRecoveryPlansClientFailoverCancelResponse], error) { +func (client *ReplicationRecoveryPlansClient) BeginFailoverCancel(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginFailoverCancelOptions) (*runtime.Poller[ReplicationRecoveryPlansClientFailoverCancelResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.failoverCancel(ctx, resourceName, resourceGroupName, recoveryPlanName, options) + resp, err := client.failoverCancel(ctx, resourceGroupName, resourceName, recoveryPlanName, options) if err != nil { return nil, err } @@ -237,14 +237,14 @@ 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 2023-08-01 -func (client *ReplicationRecoveryPlansClient) failoverCancel(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginFailoverCancelOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationRecoveryPlansClient) failoverCancel(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginFailoverCancelOptions) (*http.Response, error) { var err error const operationName = "ReplicationRecoveryPlansClient.BeginFailoverCancel" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.failoverCancelCreateRequest(ctx, resourceName, resourceGroupName, recoveryPlanName, options) + req, err := client.failoverCancelCreateRequest(ctx, resourceGroupName, resourceName, recoveryPlanName, options) if err != nil { return nil, err } @@ -260,16 +260,16 @@ func (client *ReplicationRecoveryPlansClient) failoverCancel(ctx context.Context } // failoverCancelCreateRequest creates the FailoverCancel request. -func (client *ReplicationRecoveryPlansClient) failoverCancelCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginFailoverCancelOptions) (*policy.Request, error) { +func (client *ReplicationRecoveryPlansClient) failoverCancelCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginFailoverCancelOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCancel" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -283,7 +283,7 @@ func (client *ReplicationRecoveryPlansClient) failoverCancelCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -292,15 +292,15 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - recoveryPlanName - Recovery plan name. // - options - ReplicationRecoveryPlansClientBeginFailoverCommitOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginFailoverCommit // method. -func (client *ReplicationRecoveryPlansClient) BeginFailoverCommit(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginFailoverCommitOptions) (*runtime.Poller[ReplicationRecoveryPlansClientFailoverCommitResponse], error) { +func (client *ReplicationRecoveryPlansClient) BeginFailoverCommit(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginFailoverCommitOptions) (*runtime.Poller[ReplicationRecoveryPlansClientFailoverCommitResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.failoverCommit(ctx, resourceName, resourceGroupName, recoveryPlanName, options) + resp, err := client.failoverCommit(ctx, resourceGroupName, resourceName, recoveryPlanName, options) if err != nil { return nil, err } @@ -318,14 +318,14 @@ 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 2023-08-01 -func (client *ReplicationRecoveryPlansClient) failoverCommit(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginFailoverCommitOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationRecoveryPlansClient) failoverCommit(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginFailoverCommitOptions) (*http.Response, error) { var err error const operationName = "ReplicationRecoveryPlansClient.BeginFailoverCommit" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.failoverCommitCreateRequest(ctx, resourceName, resourceGroupName, recoveryPlanName, options) + req, err := client.failoverCommitCreateRequest(ctx, resourceGroupName, resourceName, recoveryPlanName, options) if err != nil { return nil, err } @@ -341,16 +341,16 @@ func (client *ReplicationRecoveryPlansClient) failoverCommit(ctx context.Context } // failoverCommitCreateRequest creates the FailoverCommit request. -func (client *ReplicationRecoveryPlansClient) failoverCommitCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginFailoverCommitOptions) (*policy.Request, error) { +func (client *ReplicationRecoveryPlansClient) failoverCommitCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginFailoverCommitOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCommit" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -364,7 +364,7 @@ func (client *ReplicationRecoveryPlansClient) failoverCommitCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -373,19 +373,19 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - 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) { +func (client *ReplicationRecoveryPlansClient) Get(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientGetOptions) (ReplicationRecoveryPlansClientGetResponse, error) { var err error const operationName = "ReplicationRecoveryPlansClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, recoveryPlanName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, recoveryPlanName, options) if err != nil { return ReplicationRecoveryPlansClientGetResponse{}, err } @@ -402,16 +402,16 @@ func (client *ReplicationRecoveryPlansClient) Get(ctx context.Context, resourceN } // getCreateRequest creates the Get request. -func (client *ReplicationRecoveryPlansClient) getCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientGetOptions) (*policy.Request, error) { +func (client *ReplicationRecoveryPlansClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -425,7 +425,7 @@ func (client *ReplicationRecoveryPlansClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -442,12 +442,12 @@ func (client *ReplicationRecoveryPlansClient) getHandleResponse(resp *http.Respo // NewListPager - Lists the recovery plans in the vault. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - options - ReplicationRecoveryPlansClientListOptions contains the optional parameters for the ReplicationRecoveryPlansClient.NewListPager // method. -func (client *ReplicationRecoveryPlansClient) NewListPager(resourceName string, resourceGroupName string, options *ReplicationRecoveryPlansClientListOptions) *runtime.Pager[ReplicationRecoveryPlansClientListResponse] { +func (client *ReplicationRecoveryPlansClient) NewListPager(resourceGroupName string, resourceName string, options *ReplicationRecoveryPlansClientListOptions) *runtime.Pager[ReplicationRecoveryPlansClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationRecoveryPlansClientListResponse]{ More: func(page ReplicationRecoveryPlansClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -459,7 +459,7 @@ func (client *ReplicationRecoveryPlansClient) NewListPager(resourceName string, nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceName, resourceGroupName, options) + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) }, nil) if err != nil { return ReplicationRecoveryPlansClientListResponse{}, err @@ -471,16 +471,16 @@ func (client *ReplicationRecoveryPlansClient) NewListPager(resourceName string, } // listCreateRequest creates the List request. -func (client *ReplicationRecoveryPlansClient) listCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, options *ReplicationRecoveryPlansClientListOptions) (*policy.Request, error) { +func (client *ReplicationRecoveryPlansClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicationRecoveryPlansClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -490,7 +490,7 @@ func (client *ReplicationRecoveryPlansClient) listCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -508,16 +508,16 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - recoveryPlanName - Recovery plan name. // - input - Failover input. // - options - ReplicationRecoveryPlansClientBeginPlannedFailoverOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginPlannedFailover // method. -func (client *ReplicationRecoveryPlansClient) BeginPlannedFailover(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input RecoveryPlanPlannedFailoverInput, options *ReplicationRecoveryPlansClientBeginPlannedFailoverOptions) (*runtime.Poller[ReplicationRecoveryPlansClientPlannedFailoverResponse], error) { +func (client *ReplicationRecoveryPlansClient) BeginPlannedFailover(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, input RecoveryPlanPlannedFailoverInput, options *ReplicationRecoveryPlansClientBeginPlannedFailoverOptions) (*runtime.Poller[ReplicationRecoveryPlansClientPlannedFailoverResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.plannedFailover(ctx, resourceName, resourceGroupName, recoveryPlanName, input, options) + resp, err := client.plannedFailover(ctx, resourceGroupName, resourceName, recoveryPlanName, input, options) if err != nil { return nil, err } @@ -535,14 +535,14 @@ 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 2023-08-01 -func (client *ReplicationRecoveryPlansClient) plannedFailover(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input RecoveryPlanPlannedFailoverInput, options *ReplicationRecoveryPlansClientBeginPlannedFailoverOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationRecoveryPlansClient) plannedFailover(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, input RecoveryPlanPlannedFailoverInput, options *ReplicationRecoveryPlansClientBeginPlannedFailoverOptions) (*http.Response, error) { var err error const operationName = "ReplicationRecoveryPlansClient.BeginPlannedFailover" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.plannedFailoverCreateRequest(ctx, resourceName, resourceGroupName, recoveryPlanName, input, options) + req, err := client.plannedFailoverCreateRequest(ctx, resourceGroupName, resourceName, recoveryPlanName, input, options) if err != nil { return nil, err } @@ -558,16 +558,16 @@ func (client *ReplicationRecoveryPlansClient) plannedFailover(ctx context.Contex } // plannedFailoverCreateRequest creates the PlannedFailover request. -func (client *ReplicationRecoveryPlansClient) plannedFailoverCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input RecoveryPlanPlannedFailoverInput, options *ReplicationRecoveryPlansClientBeginPlannedFailoverOptions) (*policy.Request, error) { +func (client *ReplicationRecoveryPlansClient) plannedFailoverCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, input RecoveryPlanPlannedFailoverInput, options *ReplicationRecoveryPlansClientBeginPlannedFailoverOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/plannedFailover" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -581,7 +581,7 @@ func (client *ReplicationRecoveryPlansClient) plannedFailoverCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, input); err != nil { @@ -590,18 +590,19 @@ func (client *ReplicationRecoveryPlansClient) plannedFailoverCreateRequest(ctx c return req, nil } -// BeginReprotect - The operation to reprotect(reverse replicate) a recovery plan. +// BeginReprotect - The operation to reprotect(reverse replicate) a recovery plan. This api is for deprecated scenarios and +// no longer works. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - recoveryPlanName - Recovery plan name. // - options - ReplicationRecoveryPlansClientBeginReprotectOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginReprotect // method. -func (client *ReplicationRecoveryPlansClient) BeginReprotect(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginReprotectOptions) (*runtime.Poller[ReplicationRecoveryPlansClientReprotectResponse], error) { +func (client *ReplicationRecoveryPlansClient) BeginReprotect(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginReprotectOptions) (*runtime.Poller[ReplicationRecoveryPlansClientReprotectResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.reprotect(ctx, resourceName, resourceGroupName, recoveryPlanName, options) + resp, err := client.reprotect(ctx, resourceGroupName, resourceName, recoveryPlanName, options) if err != nil { return nil, err } @@ -616,17 +617,18 @@ func (client *ReplicationRecoveryPlansClient) BeginReprotect(ctx context.Context } } -// Reprotect - The operation to reprotect(reverse replicate) a recovery plan. +// Reprotect - The operation to reprotect(reverse replicate) a recovery plan. This api is for deprecated scenarios and no +// longer works. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 -func (client *ReplicationRecoveryPlansClient) reprotect(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginReprotectOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationRecoveryPlansClient) reprotect(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginReprotectOptions) (*http.Response, error) { var err error const operationName = "ReplicationRecoveryPlansClient.BeginReprotect" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.reprotectCreateRequest(ctx, resourceName, resourceGroupName, recoveryPlanName, options) + req, err := client.reprotectCreateRequest(ctx, resourceGroupName, resourceName, recoveryPlanName, options) if err != nil { return nil, err } @@ -642,16 +644,16 @@ func (client *ReplicationRecoveryPlansClient) reprotect(ctx context.Context, res } // reprotectCreateRequest creates the Reprotect request. -func (client *ReplicationRecoveryPlansClient) reprotectCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginReprotectOptions) (*policy.Request, error) { +func (client *ReplicationRecoveryPlansClient) reprotectCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, options *ReplicationRecoveryPlansClientBeginReprotectOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/reProtect" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -665,7 +667,7 @@ func (client *ReplicationRecoveryPlansClient) reprotectCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -674,16 +676,16 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - recoveryPlanName - Recovery plan name. // - input - Recovery plan test failover input. // - options - ReplicationRecoveryPlansClientBeginTestFailoverOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginTestFailover // method. -func (client *ReplicationRecoveryPlansClient) BeginTestFailover(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input RecoveryPlanTestFailoverInput, options *ReplicationRecoveryPlansClientBeginTestFailoverOptions) (*runtime.Poller[ReplicationRecoveryPlansClientTestFailoverResponse], error) { +func (client *ReplicationRecoveryPlansClient) BeginTestFailover(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, input RecoveryPlanTestFailoverInput, options *ReplicationRecoveryPlansClientBeginTestFailoverOptions) (*runtime.Poller[ReplicationRecoveryPlansClientTestFailoverResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.testFailover(ctx, resourceName, resourceGroupName, recoveryPlanName, input, options) + resp, err := client.testFailover(ctx, resourceGroupName, resourceName, recoveryPlanName, input, options) if err != nil { return nil, err } @@ -701,14 +703,14 @@ 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 2023-08-01 -func (client *ReplicationRecoveryPlansClient) testFailover(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input RecoveryPlanTestFailoverInput, options *ReplicationRecoveryPlansClientBeginTestFailoverOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationRecoveryPlansClient) testFailover(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, input RecoveryPlanTestFailoverInput, options *ReplicationRecoveryPlansClientBeginTestFailoverOptions) (*http.Response, error) { var err error const operationName = "ReplicationRecoveryPlansClient.BeginTestFailover" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.testFailoverCreateRequest(ctx, resourceName, resourceGroupName, recoveryPlanName, input, options) + req, err := client.testFailoverCreateRequest(ctx, resourceGroupName, resourceName, recoveryPlanName, input, options) if err != nil { return nil, err } @@ -724,16 +726,16 @@ func (client *ReplicationRecoveryPlansClient) testFailover(ctx context.Context, } // testFailoverCreateRequest creates the TestFailover request. -func (client *ReplicationRecoveryPlansClient) testFailoverCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input RecoveryPlanTestFailoverInput, options *ReplicationRecoveryPlansClientBeginTestFailoverOptions) (*policy.Request, error) { +func (client *ReplicationRecoveryPlansClient) testFailoverCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, input RecoveryPlanTestFailoverInput, options *ReplicationRecoveryPlansClientBeginTestFailoverOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailover" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -747,7 +749,7 @@ func (client *ReplicationRecoveryPlansClient) testFailoverCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, input); err != nil { @@ -759,16 +761,16 @@ func (client *ReplicationRecoveryPlansClient) testFailoverCreateRequest(ctx cont // 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - recoveryPlanName - Recovery plan name. // - input - Recovery plan test failover cleanup input. // - options - ReplicationRecoveryPlansClientBeginTestFailoverCleanupOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginTestFailoverCleanup // method. -func (client *ReplicationRecoveryPlansClient) BeginTestFailoverCleanup(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input RecoveryPlanTestFailoverCleanupInput, options *ReplicationRecoveryPlansClientBeginTestFailoverCleanupOptions) (*runtime.Poller[ReplicationRecoveryPlansClientTestFailoverCleanupResponse], error) { +func (client *ReplicationRecoveryPlansClient) BeginTestFailoverCleanup(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, input RecoveryPlanTestFailoverCleanupInput, options *ReplicationRecoveryPlansClientBeginTestFailoverCleanupOptions) (*runtime.Poller[ReplicationRecoveryPlansClientTestFailoverCleanupResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.testFailoverCleanup(ctx, resourceName, resourceGroupName, recoveryPlanName, input, options) + resp, err := client.testFailoverCleanup(ctx, resourceGroupName, resourceName, recoveryPlanName, input, options) if err != nil { return nil, err } @@ -786,14 +788,14 @@ 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 2023-08-01 -func (client *ReplicationRecoveryPlansClient) testFailoverCleanup(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input RecoveryPlanTestFailoverCleanupInput, options *ReplicationRecoveryPlansClientBeginTestFailoverCleanupOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationRecoveryPlansClient) testFailoverCleanup(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, input RecoveryPlanTestFailoverCleanupInput, options *ReplicationRecoveryPlansClientBeginTestFailoverCleanupOptions) (*http.Response, error) { var err error const operationName = "ReplicationRecoveryPlansClient.BeginTestFailoverCleanup" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.testFailoverCleanupCreateRequest(ctx, resourceName, resourceGroupName, recoveryPlanName, input, options) + req, err := client.testFailoverCleanupCreateRequest(ctx, resourceGroupName, resourceName, recoveryPlanName, input, options) if err != nil { return nil, err } @@ -809,16 +811,16 @@ func (client *ReplicationRecoveryPlansClient) testFailoverCleanup(ctx context.Co } // testFailoverCleanupCreateRequest creates the TestFailoverCleanup request. -func (client *ReplicationRecoveryPlansClient) testFailoverCleanupCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input RecoveryPlanTestFailoverCleanupInput, options *ReplicationRecoveryPlansClientBeginTestFailoverCleanupOptions) (*policy.Request, error) { +func (client *ReplicationRecoveryPlansClient) testFailoverCleanupCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, input RecoveryPlanTestFailoverCleanupInput, options *ReplicationRecoveryPlansClientBeginTestFailoverCleanupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailoverCleanup" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -832,7 +834,7 @@ func (client *ReplicationRecoveryPlansClient) testFailoverCleanupCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, input); err != nil { @@ -844,16 +846,16 @@ func (client *ReplicationRecoveryPlansClient) testFailoverCleanupCreateRequest(c // 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - recoveryPlanName - Recovery plan name. // - input - Recovery plan unplanned failover input. // - options - ReplicationRecoveryPlansClientBeginUnplannedFailoverOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginUnplannedFailover // method. -func (client *ReplicationRecoveryPlansClient) BeginUnplannedFailover(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input RecoveryPlanUnplannedFailoverInput, options *ReplicationRecoveryPlansClientBeginUnplannedFailoverOptions) (*runtime.Poller[ReplicationRecoveryPlansClientUnplannedFailoverResponse], error) { +func (client *ReplicationRecoveryPlansClient) BeginUnplannedFailover(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, input RecoveryPlanUnplannedFailoverInput, options *ReplicationRecoveryPlansClientBeginUnplannedFailoverOptions) (*runtime.Poller[ReplicationRecoveryPlansClientUnplannedFailoverResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.unplannedFailover(ctx, resourceName, resourceGroupName, recoveryPlanName, input, options) + resp, err := client.unplannedFailover(ctx, resourceGroupName, resourceName, recoveryPlanName, input, options) if err != nil { return nil, err } @@ -871,14 +873,14 @@ 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 2023-08-01 -func (client *ReplicationRecoveryPlansClient) unplannedFailover(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input RecoveryPlanUnplannedFailoverInput, options *ReplicationRecoveryPlansClientBeginUnplannedFailoverOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationRecoveryPlansClient) unplannedFailover(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, input RecoveryPlanUnplannedFailoverInput, options *ReplicationRecoveryPlansClientBeginUnplannedFailoverOptions) (*http.Response, error) { var err error const operationName = "ReplicationRecoveryPlansClient.BeginUnplannedFailover" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.unplannedFailoverCreateRequest(ctx, resourceName, resourceGroupName, recoveryPlanName, input, options) + req, err := client.unplannedFailoverCreateRequest(ctx, resourceGroupName, resourceName, recoveryPlanName, input, options) if err != nil { return nil, err } @@ -894,16 +896,16 @@ func (client *ReplicationRecoveryPlansClient) unplannedFailover(ctx context.Cont } // unplannedFailoverCreateRequest creates the UnplannedFailover request. -func (client *ReplicationRecoveryPlansClient) unplannedFailoverCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input RecoveryPlanUnplannedFailoverInput, options *ReplicationRecoveryPlansClientBeginUnplannedFailoverOptions) (*policy.Request, error) { +func (client *ReplicationRecoveryPlansClient) unplannedFailoverCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, input RecoveryPlanUnplannedFailoverInput, options *ReplicationRecoveryPlansClientBeginUnplannedFailoverOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/unplannedFailover" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -917,7 +919,7 @@ func (client *ReplicationRecoveryPlansClient) unplannedFailoverCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, input); err != nil { @@ -929,16 +931,16 @@ func (client *ReplicationRecoveryPlansClient) unplannedFailoverCreateRequest(ctx // BeginUpdate - The operation to update a recovery plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - recoveryPlanName - Recovery plan name. // - input - Update recovery plan input. // - options - ReplicationRecoveryPlansClientBeginUpdateOptions contains the optional parameters for the ReplicationRecoveryPlansClient.BeginUpdate // method. -func (client *ReplicationRecoveryPlansClient) BeginUpdate(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input UpdateRecoveryPlanInput, options *ReplicationRecoveryPlansClientBeginUpdateOptions) (*runtime.Poller[ReplicationRecoveryPlansClientUpdateResponse], error) { +func (client *ReplicationRecoveryPlansClient) BeginUpdate(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, input UpdateRecoveryPlanInput, options *ReplicationRecoveryPlansClientBeginUpdateOptions) (*runtime.Poller[ReplicationRecoveryPlansClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceName, resourceGroupName, recoveryPlanName, input, options) + resp, err := client.update(ctx, resourceGroupName, resourceName, recoveryPlanName, input, options) if err != nil { return nil, err } @@ -956,14 +958,14 @@ 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 2023-08-01 -func (client *ReplicationRecoveryPlansClient) update(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input UpdateRecoveryPlanInput, options *ReplicationRecoveryPlansClientBeginUpdateOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationRecoveryPlansClient) update(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, input UpdateRecoveryPlanInput, options *ReplicationRecoveryPlansClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ReplicationRecoveryPlansClient.BeginUpdate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceName, resourceGroupName, recoveryPlanName, input, options) + req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, recoveryPlanName, input, options) if err != nil { return nil, err } @@ -979,16 +981,16 @@ func (client *ReplicationRecoveryPlansClient) update(ctx context.Context, resour } // updateCreateRequest creates the Update request. -func (client *ReplicationRecoveryPlansClient) updateCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, recoveryPlanName string, input UpdateRecoveryPlanInput, options *ReplicationRecoveryPlansClientBeginUpdateOptions) (*policy.Request, error) { +func (client *ReplicationRecoveryPlansClient) updateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, recoveryPlanName string, input UpdateRecoveryPlanInput, options *ReplicationRecoveryPlansClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -1002,7 +1004,7 @@ func (client *ReplicationRecoveryPlansClient) updateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, input); err != 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 80e46b53fd05..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.158Z"); 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.137Z"); return t}()), - // LastTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1601-01-01T00:00:00.000Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.158Z"); 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.137Z"); return t}()), - // LastTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T07:00:27.835Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.617Z"); 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.137Z"); return t}()), - // LastTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T07:00:27.835Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.981Z"); 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.906Z"); return t}()), - // LastTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T07:00:27.835Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.819Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.842Z"); 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.137Z"); return t}()), - // LastTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T07:00:27.835Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.220Z"); 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.906Z"); return t}()), - // LastTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-27T07:00:27.835Z"); 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 10d8b5b0c7ae..2edbe6260e8e 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationrecoveryservicesproviders_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationrecoveryservicesproviders_client.go @@ -46,17 +46,17 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - providerName - Recovery services provider name. // - addProviderInput - Add provider input. // - options - ReplicationRecoveryServicesProvidersClientBeginCreateOptions contains the optional parameters for the ReplicationRecoveryServicesProvidersClient.BeginCreate // method. -func (client *ReplicationRecoveryServicesProvidersClient) BeginCreate(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, providerName string, addProviderInput AddRecoveryServicesProviderInput, options *ReplicationRecoveryServicesProvidersClientBeginCreateOptions) (*runtime.Poller[ReplicationRecoveryServicesProvidersClientCreateResponse], error) { +func (client *ReplicationRecoveryServicesProvidersClient) BeginCreate(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, providerName string, addProviderInput AddRecoveryServicesProviderInput, options *ReplicationRecoveryServicesProvidersClientBeginCreateOptions) (*runtime.Poller[ReplicationRecoveryServicesProvidersClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceName, resourceGroupName, fabricName, providerName, addProviderInput, options) + resp, err := client.create(ctx, resourceGroupName, resourceName, fabricName, providerName, addProviderInput, options) if err != nil { return nil, err } @@ -74,14 +74,14 @@ 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 2023-08-01 -func (client *ReplicationRecoveryServicesProvidersClient) create(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, providerName string, addProviderInput AddRecoveryServicesProviderInput, options *ReplicationRecoveryServicesProvidersClientBeginCreateOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationRecoveryServicesProvidersClient) create(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, providerName string, addProviderInput AddRecoveryServicesProviderInput, options *ReplicationRecoveryServicesProvidersClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "ReplicationRecoveryServicesProvidersClient.BeginCreate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, fabricName, providerName, addProviderInput, options) + req, err := client.createCreateRequest(ctx, resourceGroupName, resourceName, fabricName, providerName, addProviderInput, options) if err != nil { return nil, err } @@ -97,16 +97,16 @@ func (client *ReplicationRecoveryServicesProvidersClient) create(ctx context.Con } // createCreateRequest creates the Create request. -func (client *ReplicationRecoveryServicesProvidersClient) createCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, providerName string, addProviderInput AddRecoveryServicesProviderInput, options *ReplicationRecoveryServicesProvidersClientBeginCreateOptions) (*policy.Request, error) { +func (client *ReplicationRecoveryServicesProvidersClient) createCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, providerName string, addProviderInput AddRecoveryServicesProviderInput, options *ReplicationRecoveryServicesProvidersClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -124,7 +124,7 @@ func (client *ReplicationRecoveryServicesProvidersClient) createCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, addProviderInput); err != nil { @@ -136,16 +136,16 @@ func (client *ReplicationRecoveryServicesProvidersClient) createCreateRequest(ct // 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - providerName - Recovery services provider name. // - options - ReplicationRecoveryServicesProvidersClientBeginDeleteOptions contains the optional parameters for the ReplicationRecoveryServicesProvidersClient.BeginDelete // method. -func (client *ReplicationRecoveryServicesProvidersClient) BeginDelete(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, providerName string, options *ReplicationRecoveryServicesProvidersClientBeginDeleteOptions) (*runtime.Poller[ReplicationRecoveryServicesProvidersClientDeleteResponse], error) { +func (client *ReplicationRecoveryServicesProvidersClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, providerName string, options *ReplicationRecoveryServicesProvidersClientBeginDeleteOptions) (*runtime.Poller[ReplicationRecoveryServicesProvidersClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceName, resourceGroupName, fabricName, providerName, options) + resp, err := client.deleteOperation(ctx, resourceGroupName, resourceName, fabricName, providerName, options) if err != nil { return nil, err } @@ -163,14 +163,14 @@ 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 2023-08-01 -func (client *ReplicationRecoveryServicesProvidersClient) deleteOperation(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, providerName string, options *ReplicationRecoveryServicesProvidersClientBeginDeleteOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationRecoveryServicesProvidersClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, providerName string, options *ReplicationRecoveryServicesProvidersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ReplicationRecoveryServicesProvidersClient.BeginDelete" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceName, resourceGroupName, fabricName, providerName, options) + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, fabricName, providerName, options) if err != nil { return nil, err } @@ -186,16 +186,16 @@ func (client *ReplicationRecoveryServicesProvidersClient) deleteOperation(ctx co } // deleteCreateRequest creates the Delete request. -func (client *ReplicationRecoveryServicesProvidersClient) deleteCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, providerName string, options *ReplicationRecoveryServicesProvidersClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ReplicationRecoveryServicesProvidersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, providerName string, options *ReplicationRecoveryServicesProvidersClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/remove" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -213,7 +213,7 @@ func (client *ReplicationRecoveryServicesProvidersClient) deleteCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -221,20 +221,20 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - providerName - Recovery services provider name. // - 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) { +func (client *ReplicationRecoveryServicesProvidersClient) Get(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, providerName string, options *ReplicationRecoveryServicesProvidersClientGetOptions) (ReplicationRecoveryServicesProvidersClientGetResponse, error) { var err error const operationName = "ReplicationRecoveryServicesProvidersClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, providerName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, fabricName, providerName, options) if err != nil { return ReplicationRecoveryServicesProvidersClientGetResponse{}, err } @@ -251,16 +251,16 @@ func (client *ReplicationRecoveryServicesProvidersClient) Get(ctx context.Contex } // getCreateRequest creates the Get request. -func (client *ReplicationRecoveryServicesProvidersClient) getCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, providerName string, options *ReplicationRecoveryServicesProvidersClientGetOptions) (*policy.Request, error) { +func (client *ReplicationRecoveryServicesProvidersClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, providerName string, options *ReplicationRecoveryServicesProvidersClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -278,7 +278,7 @@ func (client *ReplicationRecoveryServicesProvidersClient) getCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -295,12 +295,12 @@ func (client *ReplicationRecoveryServicesProvidersClient) getHandleResponse(resp // NewListPager - Lists the registered recovery services providers in the vault. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - options - ReplicationRecoveryServicesProvidersClientListOptions contains the optional parameters for the ReplicationRecoveryServicesProvidersClient.NewListPager // method. -func (client *ReplicationRecoveryServicesProvidersClient) NewListPager(resourceName string, resourceGroupName string, options *ReplicationRecoveryServicesProvidersClientListOptions) *runtime.Pager[ReplicationRecoveryServicesProvidersClientListResponse] { +func (client *ReplicationRecoveryServicesProvidersClient) NewListPager(resourceGroupName string, resourceName string, options *ReplicationRecoveryServicesProvidersClientListOptions) *runtime.Pager[ReplicationRecoveryServicesProvidersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationRecoveryServicesProvidersClientListResponse]{ More: func(page ReplicationRecoveryServicesProvidersClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -312,7 +312,7 @@ func (client *ReplicationRecoveryServicesProvidersClient) NewListPager(resourceN nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceName, resourceGroupName, options) + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) }, nil) if err != nil { return ReplicationRecoveryServicesProvidersClientListResponse{}, err @@ -324,16 +324,16 @@ func (client *ReplicationRecoveryServicesProvidersClient) NewListPager(resourceN } // listCreateRequest creates the List request. -func (client *ReplicationRecoveryServicesProvidersClient) listCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, options *ReplicationRecoveryServicesProvidersClientListOptions) (*policy.Request, error) { +func (client *ReplicationRecoveryServicesProvidersClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicationRecoveryServicesProvidersClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryServicesProviders" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -343,7 +343,7 @@ func (client *ReplicationRecoveryServicesProvidersClient) listCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -360,13 +360,13 @@ func (client *ReplicationRecoveryServicesProvidersClient) listHandleResponse(res // NewListByReplicationFabricsPager - Lists the registered recovery services providers for the specified fabric. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - options - ReplicationRecoveryServicesProvidersClientListByReplicationFabricsOptions contains the optional parameters for // the ReplicationRecoveryServicesProvidersClient.NewListByReplicationFabricsPager method. -func (client *ReplicationRecoveryServicesProvidersClient) NewListByReplicationFabricsPager(resourceName string, resourceGroupName string, fabricName string, options *ReplicationRecoveryServicesProvidersClientListByReplicationFabricsOptions) *runtime.Pager[ReplicationRecoveryServicesProvidersClientListByReplicationFabricsResponse] { +func (client *ReplicationRecoveryServicesProvidersClient) NewListByReplicationFabricsPager(resourceGroupName string, resourceName string, fabricName string, options *ReplicationRecoveryServicesProvidersClientListByReplicationFabricsOptions) *runtime.Pager[ReplicationRecoveryServicesProvidersClientListByReplicationFabricsResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationRecoveryServicesProvidersClientListByReplicationFabricsResponse]{ More: func(page ReplicationRecoveryServicesProvidersClientListByReplicationFabricsResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -378,7 +378,7 @@ func (client *ReplicationRecoveryServicesProvidersClient) NewListByReplicationFa nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByReplicationFabricsCreateRequest(ctx, resourceName, resourceGroupName, fabricName, options) + return client.listByReplicationFabricsCreateRequest(ctx, resourceGroupName, resourceName, fabricName, options) }, nil) if err != nil { return ReplicationRecoveryServicesProvidersClientListByReplicationFabricsResponse{}, err @@ -390,16 +390,16 @@ func (client *ReplicationRecoveryServicesProvidersClient) NewListByReplicationFa } // listByReplicationFabricsCreateRequest creates the ListByReplicationFabrics request. -func (client *ReplicationRecoveryServicesProvidersClient) listByReplicationFabricsCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *ReplicationRecoveryServicesProvidersClientListByReplicationFabricsOptions) (*policy.Request, error) { +func (client *ReplicationRecoveryServicesProvidersClient) listByReplicationFabricsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *ReplicationRecoveryServicesProvidersClientListByReplicationFabricsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -413,7 +413,7 @@ func (client *ReplicationRecoveryServicesProvidersClient) listByReplicationFabri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -431,16 +431,16 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - providerName - Recovery services provider name. // - options - ReplicationRecoveryServicesProvidersClientBeginPurgeOptions contains the optional parameters for the ReplicationRecoveryServicesProvidersClient.BeginPurge // method. -func (client *ReplicationRecoveryServicesProvidersClient) BeginPurge(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, providerName string, options *ReplicationRecoveryServicesProvidersClientBeginPurgeOptions) (*runtime.Poller[ReplicationRecoveryServicesProvidersClientPurgeResponse], error) { +func (client *ReplicationRecoveryServicesProvidersClient) BeginPurge(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, providerName string, options *ReplicationRecoveryServicesProvidersClientBeginPurgeOptions) (*runtime.Poller[ReplicationRecoveryServicesProvidersClientPurgeResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.purge(ctx, resourceName, resourceGroupName, fabricName, providerName, options) + resp, err := client.purge(ctx, resourceGroupName, resourceName, fabricName, providerName, options) if err != nil { return nil, err } @@ -458,14 +458,14 @@ 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 2023-08-01 -func (client *ReplicationRecoveryServicesProvidersClient) purge(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, providerName string, options *ReplicationRecoveryServicesProvidersClientBeginPurgeOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationRecoveryServicesProvidersClient) purge(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, providerName string, options *ReplicationRecoveryServicesProvidersClientBeginPurgeOptions) (*http.Response, error) { var err error const operationName = "ReplicationRecoveryServicesProvidersClient.BeginPurge" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.purgeCreateRequest(ctx, resourceName, resourceGroupName, fabricName, providerName, options) + req, err := client.purgeCreateRequest(ctx, resourceGroupName, resourceName, fabricName, providerName, options) if err != nil { return nil, err } @@ -481,16 +481,16 @@ func (client *ReplicationRecoveryServicesProvidersClient) purge(ctx context.Cont } // purgeCreateRequest creates the Purge request. -func (client *ReplicationRecoveryServicesProvidersClient) purgeCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, providerName string, options *ReplicationRecoveryServicesProvidersClientBeginPurgeOptions) (*policy.Request, error) { +func (client *ReplicationRecoveryServicesProvidersClient) purgeCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, providerName string, options *ReplicationRecoveryServicesProvidersClientBeginPurgeOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -508,7 +508,7 @@ func (client *ReplicationRecoveryServicesProvidersClient) purgeCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -516,16 +516,16 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - providerName - Recovery services provider name. // - options - ReplicationRecoveryServicesProvidersClientBeginRefreshProviderOptions contains the optional parameters for the // ReplicationRecoveryServicesProvidersClient.BeginRefreshProvider method. -func (client *ReplicationRecoveryServicesProvidersClient) BeginRefreshProvider(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, providerName string, options *ReplicationRecoveryServicesProvidersClientBeginRefreshProviderOptions) (*runtime.Poller[ReplicationRecoveryServicesProvidersClientRefreshProviderResponse], error) { +func (client *ReplicationRecoveryServicesProvidersClient) BeginRefreshProvider(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, providerName string, options *ReplicationRecoveryServicesProvidersClientBeginRefreshProviderOptions) (*runtime.Poller[ReplicationRecoveryServicesProvidersClientRefreshProviderResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.refreshProvider(ctx, resourceName, resourceGroupName, fabricName, providerName, options) + resp, err := client.refreshProvider(ctx, resourceGroupName, resourceName, fabricName, providerName, options) if err != nil { return nil, err } @@ -543,14 +543,14 @@ 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 2023-08-01 -func (client *ReplicationRecoveryServicesProvidersClient) refreshProvider(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, providerName string, options *ReplicationRecoveryServicesProvidersClientBeginRefreshProviderOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationRecoveryServicesProvidersClient) refreshProvider(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, providerName string, options *ReplicationRecoveryServicesProvidersClientBeginRefreshProviderOptions) (*http.Response, error) { var err error const operationName = "ReplicationRecoveryServicesProvidersClient.BeginRefreshProvider" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.refreshProviderCreateRequest(ctx, resourceName, resourceGroupName, fabricName, providerName, options) + req, err := client.refreshProviderCreateRequest(ctx, resourceGroupName, resourceName, fabricName, providerName, options) if err != nil { return nil, err } @@ -566,16 +566,16 @@ func (client *ReplicationRecoveryServicesProvidersClient) refreshProvider(ctx co } // refreshProviderCreateRequest creates the RefreshProvider request. -func (client *ReplicationRecoveryServicesProvidersClient) refreshProviderCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, providerName string, options *ReplicationRecoveryServicesProvidersClientBeginRefreshProviderOptions) (*policy.Request, error) { +func (client *ReplicationRecoveryServicesProvidersClient) refreshProviderCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, providerName string, options *ReplicationRecoveryServicesProvidersClientBeginRefreshProviderOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/refreshProvider" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -593,7 +593,7 @@ func (client *ReplicationRecoveryServicesProvidersClient) refreshProviderCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-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 a18387dcb12e..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.272Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.940Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.940Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.652Z"); 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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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.272Z"); 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 f3c03f2750b7..b565b0a1f929 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationstorageclassificationmappings_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationstorageclassificationmappings_client.go @@ -46,18 +46,18 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - storageClassificationName - Storage classification name. // - storageClassificationMappingName - Storage classification mapping name. // - pairingInput - Pairing input. // - options - ReplicationStorageClassificationMappingsClientBeginCreateOptions contains the optional parameters for the ReplicationStorageClassificationMappingsClient.BeginCreate // method. -func (client *ReplicationStorageClassificationMappingsClient) BeginCreate(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput StorageClassificationMappingInput, options *ReplicationStorageClassificationMappingsClientBeginCreateOptions) (*runtime.Poller[ReplicationStorageClassificationMappingsClientCreateResponse], error) { +func (client *ReplicationStorageClassificationMappingsClient) BeginCreate(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput StorageClassificationMappingInput, options *ReplicationStorageClassificationMappingsClientBeginCreateOptions) (*runtime.Poller[ReplicationStorageClassificationMappingsClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceName, resourceGroupName, fabricName, storageClassificationName, storageClassificationMappingName, pairingInput, options) + resp, err := client.create(ctx, resourceGroupName, resourceName, fabricName, storageClassificationName, storageClassificationMappingName, pairingInput, options) if err != nil { return nil, err } @@ -75,14 +75,14 @@ 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 2023-08-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) { +// Generated from API version 2025-01-01 +func (client *ReplicationStorageClassificationMappingsClient) create(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput StorageClassificationMappingInput, options *ReplicationStorageClassificationMappingsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "ReplicationStorageClassificationMappingsClient.BeginCreate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, fabricName, storageClassificationName, storageClassificationMappingName, pairingInput, options) + req, err := client.createCreateRequest(ctx, resourceGroupName, resourceName, fabricName, storageClassificationName, storageClassificationMappingName, pairingInput, options) if err != nil { return nil, err } @@ -98,16 +98,16 @@ func (client *ReplicationStorageClassificationMappingsClient) create(ctx context } // createCreateRequest creates the Create request. -func (client *ReplicationStorageClassificationMappingsClient) createCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput StorageClassificationMappingInput, options *ReplicationStorageClassificationMappingsClientBeginCreateOptions) (*policy.Request, error) { +func (client *ReplicationStorageClassificationMappingsClient) createCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, storageClassificationName string, storageClassificationMappingName string, pairingInput StorageClassificationMappingInput, options *ReplicationStorageClassificationMappingsClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -129,7 +129,7 @@ func (client *ReplicationStorageClassificationMappingsClient) createCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, pairingInput); err != nil { @@ -141,17 +141,17 @@ func (client *ReplicationStorageClassificationMappingsClient) createCreateReques // BeginDelete - The operation to delete a storage classification mapping. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - storageClassificationName - Storage classification name. // - storageClassificationMappingName - Storage classification mapping name. // - options - ReplicationStorageClassificationMappingsClientBeginDeleteOptions contains the optional parameters for the ReplicationStorageClassificationMappingsClient.BeginDelete // method. -func (client *ReplicationStorageClassificationMappingsClient) BeginDelete(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, storageClassificationName string, storageClassificationMappingName string, options *ReplicationStorageClassificationMappingsClientBeginDeleteOptions) (*runtime.Poller[ReplicationStorageClassificationMappingsClientDeleteResponse], error) { +func (client *ReplicationStorageClassificationMappingsClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, storageClassificationName string, storageClassificationMappingName string, options *ReplicationStorageClassificationMappingsClientBeginDeleteOptions) (*runtime.Poller[ReplicationStorageClassificationMappingsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceName, resourceGroupName, fabricName, storageClassificationName, storageClassificationMappingName, options) + resp, err := client.deleteOperation(ctx, resourceGroupName, resourceName, fabricName, storageClassificationName, storageClassificationMappingName, options) if err != nil { return nil, err } @@ -169,14 +169,14 @@ 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 2023-08-01 -func (client *ReplicationStorageClassificationMappingsClient) deleteOperation(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, storageClassificationName string, storageClassificationMappingName string, options *ReplicationStorageClassificationMappingsClientBeginDeleteOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationStorageClassificationMappingsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, storageClassificationName string, storageClassificationMappingName string, options *ReplicationStorageClassificationMappingsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ReplicationStorageClassificationMappingsClient.BeginDelete" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceName, resourceGroupName, fabricName, storageClassificationName, storageClassificationMappingName, options) + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, fabricName, storageClassificationName, storageClassificationMappingName, options) if err != nil { return nil, err } @@ -192,16 +192,16 @@ func (client *ReplicationStorageClassificationMappingsClient) deleteOperation(ct } // deleteCreateRequest creates the Delete request. -func (client *ReplicationStorageClassificationMappingsClient) deleteCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, storageClassificationName string, storageClassificationMappingName string, options *ReplicationStorageClassificationMappingsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ReplicationStorageClassificationMappingsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, storageClassificationName string, storageClassificationMappingName string, options *ReplicationStorageClassificationMappingsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -223,7 +223,7 @@ func (client *ReplicationStorageClassificationMappingsClient) deleteCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -231,21 +231,21 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - storageClassificationName - Storage classification name. // - storageClassificationMappingName - Storage classification mapping name. // - 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) { +func (client *ReplicationStorageClassificationMappingsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, storageClassificationName string, storageClassificationMappingName string, options *ReplicationStorageClassificationMappingsClientGetOptions) (ReplicationStorageClassificationMappingsClientGetResponse, error) { var err error const operationName = "ReplicationStorageClassificationMappingsClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, storageClassificationName, storageClassificationMappingName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, fabricName, storageClassificationName, storageClassificationMappingName, options) if err != nil { return ReplicationStorageClassificationMappingsClientGetResponse{}, err } @@ -262,16 +262,16 @@ func (client *ReplicationStorageClassificationMappingsClient) Get(ctx context.Co } // getCreateRequest creates the Get request. -func (client *ReplicationStorageClassificationMappingsClient) getCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, storageClassificationName string, storageClassificationMappingName string, options *ReplicationStorageClassificationMappingsClientGetOptions) (*policy.Request, error) { +func (client *ReplicationStorageClassificationMappingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, storageClassificationName string, storageClassificationMappingName string, options *ReplicationStorageClassificationMappingsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -293,7 +293,7 @@ func (client *ReplicationStorageClassificationMappingsClient) getCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -310,12 +310,12 @@ func (client *ReplicationStorageClassificationMappingsClient) getHandleResponse( // NewListPager - Lists the storage classification mappings in the vault. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - options - ReplicationStorageClassificationMappingsClientListOptions contains the optional parameters for the ReplicationStorageClassificationMappingsClient.NewListPager // method. -func (client *ReplicationStorageClassificationMappingsClient) NewListPager(resourceName string, resourceGroupName string, options *ReplicationStorageClassificationMappingsClientListOptions) *runtime.Pager[ReplicationStorageClassificationMappingsClientListResponse] { +func (client *ReplicationStorageClassificationMappingsClient) NewListPager(resourceGroupName string, resourceName string, options *ReplicationStorageClassificationMappingsClientListOptions) *runtime.Pager[ReplicationStorageClassificationMappingsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationStorageClassificationMappingsClientListResponse]{ More: func(page ReplicationStorageClassificationMappingsClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -327,7 +327,7 @@ func (client *ReplicationStorageClassificationMappingsClient) NewListPager(resou nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceName, resourceGroupName, options) + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) }, nil) if err != nil { return ReplicationStorageClassificationMappingsClientListResponse{}, err @@ -339,16 +339,16 @@ func (client *ReplicationStorageClassificationMappingsClient) NewListPager(resou } // listCreateRequest creates the List request. -func (client *ReplicationStorageClassificationMappingsClient) listCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, options *ReplicationStorageClassificationMappingsClientListOptions) (*policy.Request, error) { +func (client *ReplicationStorageClassificationMappingsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicationStorageClassificationMappingsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationStorageClassificationMappings" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -358,7 +358,7 @@ func (client *ReplicationStorageClassificationMappingsClient) listCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -375,14 +375,14 @@ func (client *ReplicationStorageClassificationMappingsClient) listHandleResponse // NewListByReplicationStorageClassificationsPager - Lists the storage classification mappings for the fabric. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - storageClassificationName - Storage classification name. // - options - ReplicationStorageClassificationMappingsClientListByReplicationStorageClassificationsOptions contains the optional // parameters for the ReplicationStorageClassificationMappingsClient.NewListByReplicationStorageClassificationsPager method. -func (client *ReplicationStorageClassificationMappingsClient) NewListByReplicationStorageClassificationsPager(resourceName string, resourceGroupName string, fabricName string, storageClassificationName string, options *ReplicationStorageClassificationMappingsClientListByReplicationStorageClassificationsOptions) *runtime.Pager[ReplicationStorageClassificationMappingsClientListByReplicationStorageClassificationsResponse] { +func (client *ReplicationStorageClassificationMappingsClient) NewListByReplicationStorageClassificationsPager(resourceGroupName string, resourceName string, fabricName string, storageClassificationName string, options *ReplicationStorageClassificationMappingsClientListByReplicationStorageClassificationsOptions) *runtime.Pager[ReplicationStorageClassificationMappingsClientListByReplicationStorageClassificationsResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationStorageClassificationMappingsClientListByReplicationStorageClassificationsResponse]{ More: func(page ReplicationStorageClassificationMappingsClientListByReplicationStorageClassificationsResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -394,7 +394,7 @@ func (client *ReplicationStorageClassificationMappingsClient) NewListByReplicati nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByReplicationStorageClassificationsCreateRequest(ctx, resourceName, resourceGroupName, fabricName, storageClassificationName, options) + return client.listByReplicationStorageClassificationsCreateRequest(ctx, resourceGroupName, resourceName, fabricName, storageClassificationName, options) }, nil) if err != nil { return ReplicationStorageClassificationMappingsClientListByReplicationStorageClassificationsResponse{}, err @@ -406,16 +406,16 @@ func (client *ReplicationStorageClassificationMappingsClient) NewListByReplicati } // listByReplicationStorageClassificationsCreateRequest creates the ListByReplicationStorageClassifications request. -func (client *ReplicationStorageClassificationMappingsClient) listByReplicationStorageClassificationsCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, storageClassificationName string, options *ReplicationStorageClassificationMappingsClientListByReplicationStorageClassificationsOptions) (*policy.Request, error) { +func (client *ReplicationStorageClassificationMappingsClient) listByReplicationStorageClassificationsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, storageClassificationName string, options *ReplicationStorageClassificationMappingsClientListByReplicationStorageClassificationsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -433,7 +433,7 @@ func (client *ReplicationStorageClassificationMappingsClient) listByReplicationS return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-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 37d648bd10ba..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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 d7e4d14f369f..5418fa8259b8 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationstorageclassifications_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationstorageclassifications_client.go @@ -46,20 +46,20 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - storageClassificationName - Storage classification name. // - 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) { +func (client *ReplicationStorageClassificationsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, storageClassificationName string, options *ReplicationStorageClassificationsClientGetOptions) (ReplicationStorageClassificationsClientGetResponse, error) { var err error const operationName = "ReplicationStorageClassificationsClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, storageClassificationName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, fabricName, storageClassificationName, options) if err != nil { return ReplicationStorageClassificationsClientGetResponse{}, err } @@ -76,16 +76,16 @@ func (client *ReplicationStorageClassificationsClient) Get(ctx context.Context, } // getCreateRequest creates the Get request. -func (client *ReplicationStorageClassificationsClient) getCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, storageClassificationName string, options *ReplicationStorageClassificationsClientGetOptions) (*policy.Request, error) { +func (client *ReplicationStorageClassificationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, storageClassificationName string, options *ReplicationStorageClassificationsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -103,7 +103,7 @@ func (client *ReplicationStorageClassificationsClient) getCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -120,12 +120,12 @@ func (client *ReplicationStorageClassificationsClient) getHandleResponse(resp *h // NewListPager - Lists the storage classifications in the vault. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - options - ReplicationStorageClassificationsClientListOptions contains the optional parameters for the ReplicationStorageClassificationsClient.NewListPager // method. -func (client *ReplicationStorageClassificationsClient) NewListPager(resourceName string, resourceGroupName string, options *ReplicationStorageClassificationsClientListOptions) *runtime.Pager[ReplicationStorageClassificationsClientListResponse] { +func (client *ReplicationStorageClassificationsClient) NewListPager(resourceGroupName string, resourceName string, options *ReplicationStorageClassificationsClientListOptions) *runtime.Pager[ReplicationStorageClassificationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationStorageClassificationsClientListResponse]{ More: func(page ReplicationStorageClassificationsClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -137,7 +137,7 @@ func (client *ReplicationStorageClassificationsClient) NewListPager(resourceName nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceName, resourceGroupName, options) + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) }, nil) if err != nil { return ReplicationStorageClassificationsClientListResponse{}, err @@ -149,16 +149,16 @@ func (client *ReplicationStorageClassificationsClient) NewListPager(resourceName } // listCreateRequest creates the List request. -func (client *ReplicationStorageClassificationsClient) listCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, options *ReplicationStorageClassificationsClientListOptions) (*policy.Request, error) { +func (client *ReplicationStorageClassificationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicationStorageClassificationsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationStorageClassifications" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -168,7 +168,7 @@ func (client *ReplicationStorageClassificationsClient) listCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -185,13 +185,13 @@ func (client *ReplicationStorageClassificationsClient) listHandleResponse(resp * // NewListByReplicationFabricsPager - Lists the storage classifications available in the specified fabric. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Site name of interest. // - options - ReplicationStorageClassificationsClientListByReplicationFabricsOptions contains the optional parameters for the // ReplicationStorageClassificationsClient.NewListByReplicationFabricsPager method. -func (client *ReplicationStorageClassificationsClient) NewListByReplicationFabricsPager(resourceName string, resourceGroupName string, fabricName string, options *ReplicationStorageClassificationsClientListByReplicationFabricsOptions) *runtime.Pager[ReplicationStorageClassificationsClientListByReplicationFabricsResponse] { +func (client *ReplicationStorageClassificationsClient) NewListByReplicationFabricsPager(resourceGroupName string, resourceName string, fabricName string, options *ReplicationStorageClassificationsClientListByReplicationFabricsOptions) *runtime.Pager[ReplicationStorageClassificationsClientListByReplicationFabricsResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationStorageClassificationsClientListByReplicationFabricsResponse]{ More: func(page ReplicationStorageClassificationsClientListByReplicationFabricsResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -203,7 +203,7 @@ func (client *ReplicationStorageClassificationsClient) NewListByReplicationFabri nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByReplicationFabricsCreateRequest(ctx, resourceName, resourceGroupName, fabricName, options) + return client.listByReplicationFabricsCreateRequest(ctx, resourceGroupName, resourceName, fabricName, options) }, nil) if err != nil { return ReplicationStorageClassificationsClientListByReplicationFabricsResponse{}, err @@ -215,16 +215,16 @@ func (client *ReplicationStorageClassificationsClient) NewListByReplicationFabri } // listByReplicationFabricsCreateRequest creates the ListByReplicationFabrics request. -func (client *ReplicationStorageClassificationsClient) listByReplicationFabricsCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *ReplicationStorageClassificationsClientListByReplicationFabricsOptions) (*policy.Request, error) { +func (client *ReplicationStorageClassificationsClient) listByReplicationFabricsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *ReplicationStorageClassificationsClientListByReplicationFabricsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -238,7 +238,7 @@ func (client *ReplicationStorageClassificationsClient) listByReplicationFabricsC return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-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 787e13d1b626..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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 90c5feda0886..ed36f4e4c2f7 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvaulthealth_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvaulthealth_client.go @@ -46,18 +46,18 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - 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) { +func (client *ReplicationVaultHealthClient) Get(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicationVaultHealthClientGetOptions) (ReplicationVaultHealthClientGetResponse, error) { var err error const operationName = "ReplicationVaultHealthClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return ReplicationVaultHealthClientGetResponse{}, err } @@ -74,16 +74,16 @@ func (client *ReplicationVaultHealthClient) Get(ctx context.Context, resourceNam } // getCreateRequest creates the Get request. -func (client *ReplicationVaultHealthClient) getCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, options *ReplicationVaultHealthClientGetOptions) (*policy.Request, error) { +func (client *ReplicationVaultHealthClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicationVaultHealthClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -93,7 +93,7 @@ func (client *ReplicationVaultHealthClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -111,14 +111,14 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - options - ReplicationVaultHealthClientBeginRefreshOptions contains the optional parameters for the ReplicationVaultHealthClient.BeginRefresh // method. -func (client *ReplicationVaultHealthClient) BeginRefresh(ctx context.Context, resourceName string, resourceGroupName string, options *ReplicationVaultHealthClientBeginRefreshOptions) (*runtime.Poller[ReplicationVaultHealthClientRefreshResponse], error) { +func (client *ReplicationVaultHealthClient) BeginRefresh(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicationVaultHealthClientBeginRefreshOptions) (*runtime.Poller[ReplicationVaultHealthClientRefreshResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.refresh(ctx, resourceName, resourceGroupName, options) + resp, err := client.refresh(ctx, resourceGroupName, resourceName, options) if err != nil { return nil, err } @@ -136,14 +136,14 @@ 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 2023-08-01 -func (client *ReplicationVaultHealthClient) refresh(ctx context.Context, resourceName string, resourceGroupName string, options *ReplicationVaultHealthClientBeginRefreshOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationVaultHealthClient) refresh(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicationVaultHealthClientBeginRefreshOptions) (*http.Response, error) { var err error const operationName = "ReplicationVaultHealthClient.BeginRefresh" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.refreshCreateRequest(ctx, resourceName, resourceGroupName, options) + req, err := client.refreshCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return nil, err } @@ -159,16 +159,16 @@ func (client *ReplicationVaultHealthClient) refresh(ctx context.Context, resourc } // refreshCreateRequest creates the Refresh request. -func (client *ReplicationVaultHealthClient) refreshCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, options *ReplicationVaultHealthClientBeginRefreshOptions) (*policy.Request, error) { +func (client *ReplicationVaultHealthClient) refreshCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicationVaultHealthClientBeginRefreshOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth/default/refresh" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -178,7 +178,7 @@ func (client *ReplicationVaultHealthClient) refreshCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-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 6d30c6d3f058..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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 0aa1c586d5ef..f3ddea3b09b7 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvaultsetting_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvaultsetting_client.go @@ -46,16 +46,16 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - vaultSettingName - Vault setting name. // - input - Vault setting creation input. // - options - ReplicationVaultSettingClientBeginCreateOptions contains the optional parameters for the ReplicationVaultSettingClient.BeginCreate // method. -func (client *ReplicationVaultSettingClient) BeginCreate(ctx context.Context, resourceName string, resourceGroupName string, vaultSettingName string, input VaultSettingCreationInput, options *ReplicationVaultSettingClientBeginCreateOptions) (*runtime.Poller[ReplicationVaultSettingClientCreateResponse], error) { +func (client *ReplicationVaultSettingClient) BeginCreate(ctx context.Context, resourceGroupName string, resourceName string, vaultSettingName string, input VaultSettingCreationInput, options *ReplicationVaultSettingClientBeginCreateOptions) (*runtime.Poller[ReplicationVaultSettingClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceName, resourceGroupName, vaultSettingName, input, options) + resp, err := client.create(ctx, resourceGroupName, resourceName, vaultSettingName, input, options) if err != nil { return nil, err } @@ -73,14 +73,14 @@ 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 2023-08-01 -func (client *ReplicationVaultSettingClient) create(ctx context.Context, resourceName string, resourceGroupName string, vaultSettingName string, input VaultSettingCreationInput, options *ReplicationVaultSettingClientBeginCreateOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationVaultSettingClient) create(ctx context.Context, resourceGroupName string, resourceName string, vaultSettingName string, input VaultSettingCreationInput, options *ReplicationVaultSettingClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "ReplicationVaultSettingClient.BeginCreate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, vaultSettingName, input, options) + req, err := client.createCreateRequest(ctx, resourceGroupName, resourceName, vaultSettingName, input, options) if err != nil { return nil, err } @@ -96,16 +96,16 @@ func (client *ReplicationVaultSettingClient) create(ctx context.Context, resourc } // createCreateRequest creates the Create request. -func (client *ReplicationVaultSettingClient) createCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, vaultSettingName string, input VaultSettingCreationInput, options *ReplicationVaultSettingClientBeginCreateOptions) (*policy.Request, error) { +func (client *ReplicationVaultSettingClient) createCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, vaultSettingName string, input VaultSettingCreationInput, options *ReplicationVaultSettingClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -119,7 +119,7 @@ func (client *ReplicationVaultSettingClient) createCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, input); err != nil { @@ -131,19 +131,19 @@ func (client *ReplicationVaultSettingClient) createCreateRequest(ctx context.Con // 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - 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) { +func (client *ReplicationVaultSettingClient) Get(ctx context.Context, resourceGroupName string, resourceName string, vaultSettingName string, options *ReplicationVaultSettingClientGetOptions) (ReplicationVaultSettingClientGetResponse, error) { var err error const operationName = "ReplicationVaultSettingClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, vaultSettingName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, vaultSettingName, options) if err != nil { return ReplicationVaultSettingClientGetResponse{}, err } @@ -160,16 +160,16 @@ func (client *ReplicationVaultSettingClient) Get(ctx context.Context, resourceNa } // getCreateRequest creates the Get request. -func (client *ReplicationVaultSettingClient) getCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, vaultSettingName string, options *ReplicationVaultSettingClientGetOptions) (*policy.Request, error) { +func (client *ReplicationVaultSettingClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, vaultSettingName string, options *ReplicationVaultSettingClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -183,7 +183,7 @@ func (client *ReplicationVaultSettingClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -200,12 +200,12 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - options - ReplicationVaultSettingClientListOptions contains the optional parameters for the ReplicationVaultSettingClient.NewListPager // method. -func (client *ReplicationVaultSettingClient) NewListPager(resourceName string, resourceGroupName string, options *ReplicationVaultSettingClientListOptions) *runtime.Pager[ReplicationVaultSettingClientListResponse] { +func (client *ReplicationVaultSettingClient) NewListPager(resourceGroupName string, resourceName string, options *ReplicationVaultSettingClientListOptions) *runtime.Pager[ReplicationVaultSettingClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationVaultSettingClientListResponse]{ More: func(page ReplicationVaultSettingClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -217,7 +217,7 @@ func (client *ReplicationVaultSettingClient) NewListPager(resourceName string, r nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceName, resourceGroupName, options) + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) }, nil) if err != nil { return ReplicationVaultSettingClientListResponse{}, err @@ -229,16 +229,16 @@ func (client *ReplicationVaultSettingClient) NewListPager(resourceName string, r } // listCreateRequest creates the List request. -func (client *ReplicationVaultSettingClient) listCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, options *ReplicationVaultSettingClientListOptions) (*policy.Request, error) { +func (client *ReplicationVaultSettingClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicationVaultSettingClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -248,7 +248,7 @@ func (client *ReplicationVaultSettingClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-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 7f2fc77eb957..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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 32e929ebdb9a..83f2040eb20e 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvcenters_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/replicationvcenters_client.go @@ -46,17 +46,17 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - vcenterName - vcenter name. // - addVCenterRequest - The input to the add vCenter operation. // - options - ReplicationvCentersClientBeginCreateOptions contains the optional parameters for the ReplicationvCentersClient.BeginCreate // method. -func (client *ReplicationvCentersClient) BeginCreate(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, vcenterName string, addVCenterRequest AddVCenterRequest, options *ReplicationvCentersClientBeginCreateOptions) (*runtime.Poller[ReplicationvCentersClientCreateResponse], error) { +func (client *ReplicationvCentersClient) BeginCreate(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, vcenterName string, addVCenterRequest AddVCenterRequest, options *ReplicationvCentersClientBeginCreateOptions) (*runtime.Poller[ReplicationvCentersClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceName, resourceGroupName, fabricName, vcenterName, addVCenterRequest, options) + resp, err := client.create(ctx, resourceGroupName, resourceName, fabricName, vcenterName, addVCenterRequest, options) if err != nil { return nil, err } @@ -74,14 +74,14 @@ 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 2023-08-01 -func (client *ReplicationvCentersClient) create(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, vcenterName string, addVCenterRequest AddVCenterRequest, options *ReplicationvCentersClientBeginCreateOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationvCentersClient) create(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, vcenterName string, addVCenterRequest AddVCenterRequest, options *ReplicationvCentersClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "ReplicationvCentersClient.BeginCreate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceName, resourceGroupName, fabricName, vcenterName, addVCenterRequest, options) + req, err := client.createCreateRequest(ctx, resourceGroupName, resourceName, fabricName, vcenterName, addVCenterRequest, options) if err != nil { return nil, err } @@ -97,16 +97,16 @@ func (client *ReplicationvCentersClient) create(ctx context.Context, resourceNam } // createCreateRequest creates the Create request. -func (client *ReplicationvCentersClient) createCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, vcenterName string, addVCenterRequest AddVCenterRequest, options *ReplicationvCentersClientBeginCreateOptions) (*policy.Request, error) { +func (client *ReplicationvCentersClient) createCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, vcenterName string, addVCenterRequest AddVCenterRequest, options *ReplicationvCentersClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -124,7 +124,7 @@ func (client *ReplicationvCentersClient) createCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, addVCenterRequest); err != nil { @@ -136,16 +136,16 @@ func (client *ReplicationvCentersClient) createCreateRequest(ctx context.Context // 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - vcenterName - vcenter name. // - options - ReplicationvCentersClientBeginDeleteOptions contains the optional parameters for the ReplicationvCentersClient.BeginDelete // method. -func (client *ReplicationvCentersClient) BeginDelete(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, vcenterName string, options *ReplicationvCentersClientBeginDeleteOptions) (*runtime.Poller[ReplicationvCentersClientDeleteResponse], error) { +func (client *ReplicationvCentersClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, vcenterName string, options *ReplicationvCentersClientBeginDeleteOptions) (*runtime.Poller[ReplicationvCentersClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceName, resourceGroupName, fabricName, vcenterName, options) + resp, err := client.deleteOperation(ctx, resourceGroupName, resourceName, fabricName, vcenterName, options) if err != nil { return nil, err } @@ -163,14 +163,14 @@ 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 2023-08-01 -func (client *ReplicationvCentersClient) deleteOperation(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, vcenterName string, options *ReplicationvCentersClientBeginDeleteOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationvCentersClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, vcenterName string, options *ReplicationvCentersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ReplicationvCentersClient.BeginDelete" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceName, resourceGroupName, fabricName, vcenterName, options) + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, fabricName, vcenterName, options) if err != nil { return nil, err } @@ -186,16 +186,16 @@ func (client *ReplicationvCentersClient) deleteOperation(ctx context.Context, re } // deleteCreateRequest creates the Delete request. -func (client *ReplicationvCentersClient) deleteCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, vcenterName string, options *ReplicationvCentersClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ReplicationvCentersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, vcenterName string, options *ReplicationvCentersClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -213,7 +213,7 @@ func (client *ReplicationvCentersClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -221,19 +221,19 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - 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) { +func (client *ReplicationvCentersClient) Get(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, vcenterName string, options *ReplicationvCentersClientGetOptions) (ReplicationvCentersClientGetResponse, error) { var err error const operationName = "ReplicationvCentersClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, fabricName, vcenterName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, fabricName, vcenterName, options) if err != nil { return ReplicationvCentersClientGetResponse{}, err } @@ -250,16 +250,16 @@ func (client *ReplicationvCentersClient) Get(ctx context.Context, resourceName s } // getCreateRequest creates the Get request. -func (client *ReplicationvCentersClient) getCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, vcenterName string, options *ReplicationvCentersClientGetOptions) (*policy.Request, error) { +func (client *ReplicationvCentersClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, vcenterName string, options *ReplicationvCentersClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -277,7 +277,7 @@ func (client *ReplicationvCentersClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -294,12 +294,12 @@ func (client *ReplicationvCentersClient) getHandleResponse(resp *http.Response) // NewListPager - Lists the vCenter servers registered in the vault. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - options - ReplicationvCentersClientListOptions contains the optional parameters for the ReplicationvCentersClient.NewListPager // method. -func (client *ReplicationvCentersClient) NewListPager(resourceName string, resourceGroupName string, options *ReplicationvCentersClientListOptions) *runtime.Pager[ReplicationvCentersClientListResponse] { +func (client *ReplicationvCentersClient) NewListPager(resourceGroupName string, resourceName string, options *ReplicationvCentersClientListOptions) *runtime.Pager[ReplicationvCentersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationvCentersClientListResponse]{ More: func(page ReplicationvCentersClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -311,7 +311,7 @@ func (client *ReplicationvCentersClient) NewListPager(resourceName string, resou nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceName, resourceGroupName, options) + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) }, nil) if err != nil { return ReplicationvCentersClientListResponse{}, err @@ -323,16 +323,16 @@ func (client *ReplicationvCentersClient) NewListPager(resourceName string, resou } // listCreateRequest creates the List request. -func (client *ReplicationvCentersClient) listCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, options *ReplicationvCentersClientListOptions) (*policy.Request, error) { +func (client *ReplicationvCentersClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ReplicationvCentersClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationvCenters" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -342,7 +342,7 @@ func (client *ReplicationvCentersClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -359,13 +359,13 @@ func (client *ReplicationvCentersClient) listHandleResponse(resp *http.Response) // NewListByReplicationFabricsPager - Lists the vCenter servers registered in a fabric. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - options - ReplicationvCentersClientListByReplicationFabricsOptions contains the optional parameters for the ReplicationvCentersClient.NewListByReplicationFabricsPager // method. -func (client *ReplicationvCentersClient) NewListByReplicationFabricsPager(resourceName string, resourceGroupName string, fabricName string, options *ReplicationvCentersClientListByReplicationFabricsOptions) *runtime.Pager[ReplicationvCentersClientListByReplicationFabricsResponse] { +func (client *ReplicationvCentersClient) NewListByReplicationFabricsPager(resourceGroupName string, resourceName string, fabricName string, options *ReplicationvCentersClientListByReplicationFabricsOptions) *runtime.Pager[ReplicationvCentersClientListByReplicationFabricsResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationvCentersClientListByReplicationFabricsResponse]{ More: func(page ReplicationvCentersClientListByReplicationFabricsResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -377,7 +377,7 @@ func (client *ReplicationvCentersClient) NewListByReplicationFabricsPager(resour nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByReplicationFabricsCreateRequest(ctx, resourceName, resourceGroupName, fabricName, options) + return client.listByReplicationFabricsCreateRequest(ctx, resourceGroupName, resourceName, fabricName, options) }, nil) if err != nil { return ReplicationvCentersClientListByReplicationFabricsResponse{}, err @@ -389,16 +389,16 @@ func (client *ReplicationvCentersClient) NewListByReplicationFabricsPager(resour } // listByReplicationFabricsCreateRequest creates the ListByReplicationFabrics request. -func (client *ReplicationvCentersClient) listByReplicationFabricsCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, options *ReplicationvCentersClientListByReplicationFabricsOptions) (*policy.Request, error) { +func (client *ReplicationvCentersClient) listByReplicationFabricsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, options *ReplicationvCentersClientListByReplicationFabricsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -412,7 +412,7 @@ func (client *ReplicationvCentersClient) listByReplicationFabricsCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -430,17 +430,17 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - vcenterName - vcenter name. // - updateVCenterRequest - The input to the update vCenter operation. // - options - ReplicationvCentersClientBeginUpdateOptions contains the optional parameters for the ReplicationvCentersClient.BeginUpdate // method. -func (client *ReplicationvCentersClient) BeginUpdate(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, vcenterName string, updateVCenterRequest UpdateVCenterRequest, options *ReplicationvCentersClientBeginUpdateOptions) (*runtime.Poller[ReplicationvCentersClientUpdateResponse], error) { +func (client *ReplicationvCentersClient) BeginUpdate(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, vcenterName string, updateVCenterRequest UpdateVCenterRequest, options *ReplicationvCentersClientBeginUpdateOptions) (*runtime.Poller[ReplicationvCentersClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceName, resourceGroupName, fabricName, vcenterName, updateVCenterRequest, options) + resp, err := client.update(ctx, resourceGroupName, resourceName, fabricName, vcenterName, updateVCenterRequest, options) if err != nil { return nil, err } @@ -458,14 +458,14 @@ 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 2023-08-01 -func (client *ReplicationvCentersClient) update(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, vcenterName string, updateVCenterRequest UpdateVCenterRequest, options *ReplicationvCentersClientBeginUpdateOptions) (*http.Response, error) { +// Generated from API version 2025-01-01 +func (client *ReplicationvCentersClient) update(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, vcenterName string, updateVCenterRequest UpdateVCenterRequest, options *ReplicationvCentersClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ReplicationvCentersClient.BeginUpdate" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceName, resourceGroupName, fabricName, vcenterName, updateVCenterRequest, options) + req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, fabricName, vcenterName, updateVCenterRequest, options) if err != nil { return nil, err } @@ -481,16 +481,16 @@ func (client *ReplicationvCentersClient) update(ctx context.Context, resourceNam } // updateCreateRequest creates the Update request. -func (client *ReplicationvCentersClient) updateCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, vcenterName string, updateVCenterRequest UpdateVCenterRequest, options *ReplicationvCentersClientBeginUpdateOptions) (*policy.Request, error) { +func (client *ReplicationvCentersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, vcenterName string, updateVCenterRequest UpdateVCenterRequest, options *ReplicationvCentersClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -508,7 +508,7 @@ func (client *ReplicationvCentersClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, updateVCenterRequest); err != 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 6d7010c97f5a..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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/responses.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/responses.go index 1ebce7e8269f..2f7cb5ab9b3e 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/responses.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/responses.go @@ -8,6 +8,18 @@ package armrecoveryservicessiterecovery +// ClusterRecoveryPointClientGetResponse contains the response from method ClusterRecoveryPointClient.Get. +type ClusterRecoveryPointClientGetResponse struct { + // Recovery point. + ClusterRecoveryPoint +} + +// ClusterRecoveryPointsClientListByReplicationProtectionClusterResponse contains the response from method ClusterRecoveryPointsClient.NewListByReplicationProtectionClusterPager. +type ClusterRecoveryPointsClientListByReplicationProtectionClusterResponse struct { + // Collection of cluster recovery point details. + ClusterRecoveryPointCollection +} + // MigrationRecoveryPointsClientGetResponse contains the response from method MigrationRecoveryPointsClient.Get. type MigrationRecoveryPointsClientGetResponse struct { // Recovery point for a migration item. @@ -498,6 +510,77 @@ type ReplicationProtectedItemsClientUpdateResponse struct { ReplicationProtectedItem } +// ReplicationProtectionClustersClientApplyRecoveryPointResponse contains the response from method ReplicationProtectionClustersClient.BeginApplyRecoveryPoint. +type ReplicationProtectionClustersClientApplyRecoveryPointResponse struct { + // Replication protection Cluster. + ReplicationProtectionCluster +} + +// ReplicationProtectionClustersClientCreateResponse contains the response from method ReplicationProtectionClustersClient.BeginCreate. +type ReplicationProtectionClustersClientCreateResponse struct { + // Replication protection Cluster. + ReplicationProtectionCluster +} + +// ReplicationProtectionClustersClientFailoverCommitResponse contains the response from method ReplicationProtectionClustersClient.BeginFailoverCommit. +type ReplicationProtectionClustersClientFailoverCommitResponse struct { + // Replication protection Cluster. + ReplicationProtectionCluster +} + +// ReplicationProtectionClustersClientGetOperationResultsResponse contains the response from method ReplicationProtectionClustersClient.GetOperationResults. +type ReplicationProtectionClustersClientGetOperationResultsResponse struct { + // Replication protection Cluster. + ReplicationProtectionCluster +} + +// ReplicationProtectionClustersClientGetResponse contains the response from method ReplicationProtectionClustersClient.Get. +type ReplicationProtectionClustersClientGetResponse struct { + // Replication protection Cluster. + ReplicationProtectionCluster +} + +// ReplicationProtectionClustersClientListByReplicationProtectionContainersResponse contains the response from method ReplicationProtectionClustersClient.NewListByReplicationProtectionContainersPager. +type ReplicationProtectionClustersClientListByReplicationProtectionContainersResponse struct { + // Replication protected item collection. + ReplicationProtectionClusterCollection +} + +// ReplicationProtectionClustersClientListResponse contains the response from method ReplicationProtectionClustersClient.NewListPager. +type ReplicationProtectionClustersClientListResponse struct { + // Replication protected item collection. + ReplicationProtectionClusterCollection +} + +// ReplicationProtectionClustersClientPurgeResponse contains the response from method ReplicationProtectionClustersClient.BeginPurge. +type ReplicationProtectionClustersClientPurgeResponse struct { + // placeholder for future response values +} + +// ReplicationProtectionClustersClientRepairReplicationResponse contains the response from method ReplicationProtectionClustersClient.BeginRepairReplication. +type ReplicationProtectionClustersClientRepairReplicationResponse struct { + // Replication protection Cluster. + ReplicationProtectionCluster +} + +// ReplicationProtectionClustersClientTestFailoverCleanupResponse contains the response from method ReplicationProtectionClustersClient.BeginTestFailoverCleanup. +type ReplicationProtectionClustersClientTestFailoverCleanupResponse struct { + // Replication protection Cluster. + ReplicationProtectionCluster +} + +// ReplicationProtectionClustersClientTestFailoverResponse contains the response from method ReplicationProtectionClustersClient.BeginTestFailover. +type ReplicationProtectionClustersClientTestFailoverResponse struct { + // Replication protection Cluster. + ReplicationProtectionCluster +} + +// ReplicationProtectionClustersClientUnplannedFailoverResponse contains the response from method ReplicationProtectionClustersClient.BeginUnplannedFailover. +type ReplicationProtectionClustersClientUnplannedFailoverResponse struct { + // Replication protection Cluster. + ReplicationProtectionCluster +} + // ReplicationProtectionContainerMappingsClientCreateResponse contains the response from method ReplicationProtectionContainerMappingsClient.BeginCreate. type ReplicationProtectionContainerMappingsClientCreateResponse struct { // Protection container mapping object. @@ -574,6 +657,12 @@ type ReplicationProtectionContainersClientListResponse struct { ProtectionContainerCollection } +// ReplicationProtectionContainersClientSwitchClusterProtectionResponse contains the response from method ReplicationProtectionContainersClient.BeginSwitchClusterProtection. +type ReplicationProtectionContainersClientSwitchClusterProtectionResponse struct { + // Protection container details. + ProtectionContainer +} + // ReplicationProtectionContainersClientSwitchProtectionResponse contains the response from method ReplicationProtectionContainersClient.BeginSwitchProtection. type ReplicationProtectionContainersClientSwitchProtectionResponse struct { // Protection container details. diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/supportedoperatingsystems_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/supportedoperatingsystems_client.go index d0ff4832503b..3397a7154910 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/supportedoperatingsystems_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/supportedoperatingsystems_client.go @@ -46,18 +46,18 @@ 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 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - 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) { +func (client *SupportedOperatingSystemsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, options *SupportedOperatingSystemsClientGetOptions) (SupportedOperatingSystemsClientGetResponse, error) { var err error const operationName = "SupportedOperatingSystemsClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceName, resourceGroupName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return SupportedOperatingSystemsClientGetResponse{}, err } @@ -74,16 +74,16 @@ func (client *SupportedOperatingSystemsClient) Get(ctx context.Context, resource } // getCreateRequest creates the Get request. -func (client *SupportedOperatingSystemsClient) getCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, options *SupportedOperatingSystemsClientGetOptions) (*policy.Request, error) { +func (client *SupportedOperatingSystemsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *SupportedOperatingSystemsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationSupportedOperatingSystems" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -93,7 +93,7 @@ func (client *SupportedOperatingSystemsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-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 c6a032a6ccb4..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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 7ee10f96c5a3..394fc1edd590 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/targetcomputesizes_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicessiterecovery/targetcomputesizes_client.go @@ -45,15 +45,15 @@ func NewTargetComputeSizesClient(subscriptionID string, credential azcore.TokenC // NewListByReplicationProtectedItemsPager - Lists the available target compute sizes for a replication protected item. // -// Generated from API version 2023-08-01 -// - resourceName - The name of the recovery services vault. +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - resourceName - The name of the recovery services vault. // - fabricName - Fabric name. // - protectionContainerName - protection container name. // - replicatedProtectedItemName - Replication protected item name. // - options - TargetComputeSizesClientListByReplicationProtectedItemsOptions contains the optional parameters for the TargetComputeSizesClient.NewListByReplicationProtectedItemsPager // method. -func (client *TargetComputeSizesClient) NewListByReplicationProtectedItemsPager(resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *TargetComputeSizesClientListByReplicationProtectedItemsOptions) *runtime.Pager[TargetComputeSizesClientListByReplicationProtectedItemsResponse] { +func (client *TargetComputeSizesClient) NewListByReplicationProtectedItemsPager(resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *TargetComputeSizesClientListByReplicationProtectedItemsOptions) *runtime.Pager[TargetComputeSizesClientListByReplicationProtectedItemsResponse] { return runtime.NewPager(runtime.PagingHandler[TargetComputeSizesClientListByReplicationProtectedItemsResponse]{ More: func(page TargetComputeSizesClientListByReplicationProtectedItemsResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -65,7 +65,7 @@ func (client *TargetComputeSizesClient) NewListByReplicationProtectedItemsPager( nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByReplicationProtectedItemsCreateRequest(ctx, resourceName, resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, options) + return client.listByReplicationProtectedItemsCreateRequest(ctx, resourceGroupName, resourceName, fabricName, protectionContainerName, replicatedProtectedItemName, options) }, nil) if err != nil { return TargetComputeSizesClientListByReplicationProtectedItemsResponse{}, err @@ -77,16 +77,16 @@ func (client *TargetComputeSizesClient) NewListByReplicationProtectedItemsPager( } // listByReplicationProtectedItemsCreateRequest creates the ListByReplicationProtectedItems request. -func (client *TargetComputeSizesClient) listByReplicationProtectedItemsCreateRequest(ctx context.Context, resourceName string, resourceGroupName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *TargetComputeSizesClientListByReplicationProtectedItemsOptions) (*policy.Request, error) { +func (client *TargetComputeSizesClient) listByReplicationProtectedItemsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, fabricName string, protectionContainerName string, replicatedProtectedItemName string, options *TargetComputeSizesClientListByReplicationProtectedItemsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/targetComputeSizes" - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -108,7 +108,7 @@ func (client *TargetComputeSizesClient) listByReplicationProtectedItemsCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2025-01-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 afbb0197ec78..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/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-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), - // }, - // }}, - // } - } -}